diff --git a/app/libs/arm64-v8a/libcamera_client.so b/app/libs/arm64-v8a/libcamera_client.so deleted file mode 100644 index 5a48af54..00000000 Binary files a/app/libs/arm64-v8a/libcamera_client.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libdevicesdk.so b/app/libs/arm64-v8a/libdevicesdk.so deleted file mode 100644 index 0a290bac..00000000 Binary files a/app/libs/arm64-v8a/libdevicesdk.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libdsdevicesdk.so b/app/libs/arm64-v8a/libdsdevicesdk.so deleted file mode 100644 index e183ce56..00000000 Binary files a/app/libs/arm64-v8a/libdsdevicesdk.so and /dev/null differ diff --git a/app/libs/arm64-v8a/libiconv.so b/app/libs/arm64-v8a/libiconv.so deleted file mode 100644 index 17f6dcb8..00000000 Binary files a/app/libs/arm64-v8a/libiconv.so and /dev/null differ diff --git a/app/src/main/java/com/dowse/base/BuildConfig.java b/app/src/main/java/com/dowse/base/BuildConfig.java deleted file mode 100644 index bc8aeeba..00000000 --- a/app/src/main/java/com/dowse/base/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dowse.base; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/BuildConfig.class */ -public final class BuildConfig { - public static final boolean DEBUG = Boolean.parseBoolean("true"); - public static final String LIBRARY_PACKAGE_NAME = "com.dowse.base"; - public static final String BUILD_TYPE = "debug"; -} diff --git a/app/src/main/java/com/dowse/base/DSParamManager.java b/app/src/main/java/com/dowse/base/DSParamManager.java deleted file mode 100644 index ed52b55b..00000000 --- a/app/src/main/java/com/dowse/base/DSParamManager.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.dowse.base; - -import android.app.Application; -import android.content.ComponentName; -import android.content.Intent; -import android.content.ServiceConnection; -import android.os.IBinder; -import android.os.RemoteException; -import com.dowse.base.IParam; -import com.dowse.base.log.DSLog; -import com.dowse.base.util.ContextUtil; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/DSParamManager.class */ -public class DSParamManager { - private static final String TAG = "ParamManager"; - private static final String PARAM_SERVICE_ACTION = "com.dowse.param.service"; - private static final String PARAM_PACKAGE = "com.dowse.param"; - private static DSParamManager instance; - private IParam mIParam = null; - private Application mContext = null; - private boolean isBindSuccess = false; - private ServiceConnection mParamServiceConnection = new ServiceConnection() { // from class: com.dowse.base.DSParamManager.1 - @Override // android.content.ServiceConnection - public void onServiceConnected(ComponentName componentName, IBinder iBinder) { - DSParamManager.this.mIParam = IParam.Stub.asInterface(iBinder); - DSParamManager.this.notifyInitResult(true); - } - - @Override // android.content.ServiceConnection - public void onServiceDisconnected(ComponentName componentName) { - DSParamManager.this.mIParam = null; - DSParamManager.this.isBindSuccess = false; - DSParamManager.this.notifyInitResult(false); - } - }; - private List listeners = new ArrayList(); - - private DSParamManager() { - initParam(); - } - - public static synchronized DSParamManager getInstance() { - if (instance == null) { - instance = new DSParamManager(); - } - return instance; - } - - private void initParam() { - if (this.mContext == null) { - this.mContext = ContextUtil.getApplication(); - } - Intent intent = new Intent(); - intent.setAction(PARAM_SERVICE_ACTION); - intent.setPackage(PARAM_PACKAGE); - this.isBindSuccess = this.mContext.bindService(intent, this.mParamServiceConnection, 1); - DSLog.d(TAG, "bind service result = " + this.isBindSuccess); - } - - public void setInitListener(IParamListener listener) { - if (listener != null) { - if (this.isBindSuccess && this.mIParam != null) { - listener.onInitResult(true); - } else { - this.listeners.add(listener); - } - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void notifyInitResult(boolean result) { - for (IParamListener listener : this.listeners) { - listener.onInitResult(result); - } - this.listeners.clear(); - } - - private void unInitParam() { - if (this.mContext == null) { - this.mContext = ContextUtil.getApplication(); - } - if (this.isBindSuccess) { - this.mContext.unbindService(this.mParamServiceConnection); - } - this.mIParam = null; - this.isBindSuccess = false; - } - - public boolean setParam(String type, String paramJsonStr, String call) { - if (this.mIParam == null) { - DSLog.e(TAG, "setParam Failed!!!,type=" + type + ",call=" + call); - if (!this.isBindSuccess) { - initParam(); - return false; - } - return false; - } - try { - return this.mIParam.setParam(type, paramJsonStr, call); - } catch (RemoteException e) { - e.printStackTrace(); - DSLog.e(TAG, "setParam Failed!!!,+type=" + type + ",call=" + call + ",RemoteException msg=" + e.getMessage()); - return false; - } - } - - public String getParam(String type, String call) { - if (this.mIParam == null) { - DSLog.e(TAG, "getParam Failed!!!,type=" + type + ",call=" + call); - if (!this.isBindSuccess) { - initParam(); - return null; - } - return null; - } - try { - return this.mIParam.getParam(type, call); - } catch (RemoteException e) { - e.printStackTrace(); - DSLog.e(TAG, "getParam Failed!!!,+type=" + type + ",call=" + call + ",RemoteException msg=" + e.getMessage()); - return null; - } - } -} diff --git a/app/src/main/java/com/dowse/base/IParam.java b/app/src/main/java/com/dowse/base/IParam.java deleted file mode 100644 index 6f9c8fe0..00000000 --- a/app/src/main/java/com/dowse/base/IParam.java +++ /dev/null @@ -1,174 +0,0 @@ -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/IParam.class */ -public interface IParam extends IInterface { - boolean setParam(String str, String str2, String str3) throws RemoteException; - - String getParam(String str, String str2) throws RemoteException; - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/IParam$Default.class */ - public static class Default implements IParam { - @Override // com.dowse.base.IParam - public boolean setParam(String type, String paramJsonStr, String call) throws RemoteException { - return false; - } - - @Override // com.dowse.base.IParam - public String getParam(String type, String call) 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/IParam$Stub.class */ - public static abstract class Stub extends Binder implements IParam { - private static final String DESCRIPTOR = "com.dowse.base.IParam"; - static final int TRANSACTION_setParam = 1; - static final int TRANSACTION_getParam = 2; - - public Stub() { - attachInterface(this, DESCRIPTOR); - } - - public static IParam asInterface(IBinder obj) { - if (obj == null) { - return null; - } - IInterface iin = obj.queryLocalInterface(DESCRIPTOR); - if (iin != null && (iin instanceof IParam)) { - return (IParam) 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); - String _arg0 = data.readString(); - String _arg1 = data.readString(); - String _arg2 = data.readString(); - boolean _result = setParam(_arg0, _arg1, _arg2); - reply.writeNoException(); - reply.writeInt(_result ? 1 : 0); - return true; - case 2: - data.enforceInterface(DESCRIPTOR); - String _arg02 = data.readString(); - String _arg12 = data.readString(); - String _result2 = getParam(_arg02, _arg12); - reply.writeNoException(); - reply.writeString(_result2); - 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/IParam$Stub$Proxy.class */ - public static class Proxy implements IParam { - private IBinder mRemote; - public static IParam 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.IParam - public boolean setParam(String type, String paramJsonStr, String call) throws RemoteException { - Parcel _data = Parcel.obtain(); - Parcel _reply = Parcel.obtain(); - try { - _data.writeInterfaceToken(Stub.DESCRIPTOR); - _data.writeString(type); - _data.writeString(paramJsonStr); - _data.writeString(call); - boolean _status = this.mRemote.transact(1, _data, _reply, 0); - if (!_status && Stub.getDefaultImpl() != null) { - boolean param = Stub.getDefaultImpl().setParam(type, paramJsonStr, call); - _reply.recycle(); - _data.recycle(); - return param; - } - _reply.readException(); - boolean _result = 0 != _reply.readInt(); - return _result; - } finally { - _reply.recycle(); - _data.recycle(); - } - } - - @Override // com.dowse.base.IParam - public String getParam(String type, String call) throws RemoteException { - Parcel _data = Parcel.obtain(); - Parcel _reply = Parcel.obtain(); - try { - _data.writeInterfaceToken(Stub.DESCRIPTOR); - _data.writeString(type); - _data.writeString(call); - boolean _status = this.mRemote.transact(2, _data, _reply, 0); - if (!_status && Stub.getDefaultImpl() != null) { - String param = Stub.getDefaultImpl().getParam(type, call); - _reply.recycle(); - _data.recycle(); - return param; - } - _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(IParam impl) { - if (Proxy.sDefaultImpl != null) { - throw new IllegalStateException("setDefaultImpl() called twice"); - } - if (impl != null) { - Proxy.sDefaultImpl = impl; - return true; - } - return false; - } - - public static IParam getDefaultImpl() { - return Proxy.sDefaultImpl; - } - } -} diff --git a/app/src/main/java/com/dowse/base/IParamListener.java b/app/src/main/java/com/dowse/base/IParamListener.java deleted file mode 100644 index 911e84cb..00000000 --- a/app/src/main/java/com/dowse/base/IParamListener.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.dowse.base; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/IParamListener.class */ -public interface IParamListener { - void onInitResult(boolean z); -} diff --git a/app/src/main/java/com/dowse/base/IRemote.java b/app/src/main/java/com/dowse/base/IRemote.java deleted file mode 100644 index 5fb12bf2..00000000 --- a/app/src/main/java/com/dowse/base/IRemote.java +++ /dev/null @@ -1,259 +0,0 @@ -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; - } - } -} diff --git a/app/src/main/java/com/dowse/base/audio/AACEncode.java b/app/src/main/java/com/dowse/base/audio/AACEncode.java deleted file mode 100644 index 83630a31..00000000 --- a/app/src/main/java/com/dowse/base/audio/AACEncode.java +++ /dev/null @@ -1,136 +0,0 @@ -package com.dowse.base.audio; - -import android.media.MediaCodec; -import android.media.MediaCrypto; -import android.media.MediaFormat; -import android.view.Surface; -import com.dowse.base.log.DSLog; -import com.dowse.base.param.AACAudioParam; -import java.io.ByteArrayOutputStream; -import java.nio.ByteBuffer; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/AACEncode.class */ -public class AACEncode { - private static final String TAG = "AACEncode"; - private MediaCodec mediaCodec; - private AACAudioParam mAACAudioParam; - MediaCodec.BufferInfo bufferInfo; - long presentationTimeUs; - private String mediaType = "OMX.google.aac.encoder"; - ByteBuffer[] inputBuffers = null; - ByteBuffer[] outputBuffers = null; - private boolean isInit = false; - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - - public AACEncode() { - this.presentationTimeUs = 0L; - this.presentationTimeUs = 0L; - } - - public void init(AACAudioParam mAACAudioParam) { - if (this.isInit) { - DSLog.d(TAG, "AACEncode is initiated"); - return; - } - if (mAACAudioParam == null) { - mAACAudioParam = new AACAudioParam(); - } - try { - this.mediaCodec = MediaCodec.createEncoderByType("audio/mp4a-latm"); - this.isInit = true; - MediaFormat mediaFormat = MediaFormat.createAudioFormat("audio/mp4a-latm", mAACAudioParam.getSample_rate(), mAACAudioParam.getChannel_count()); - mediaFormat.setString("mime", "audio/mp4a-latm"); - mediaFormat.setInteger("aac-profile", 2); - mediaFormat.setInteger("bitrate", mAACAudioParam.getBit_rate()); - mediaFormat.setInteger("max-input-size", mAACAudioParam.getMax_input_size()); - this.mediaCodec.configure(mediaFormat, (Surface) null, (MediaCrypto) null, 1); - this.mediaCodec.start(); - this.inputBuffers = this.mediaCodec.getInputBuffers(); - this.outputBuffers = this.mediaCodec.getOutputBuffers(); - this.bufferInfo = new MediaCodec.BufferInfo(); - } catch (Exception e) { - e.printStackTrace(); - DSLog.d(TAG, "AACEncode exception msg=" + e.getMessage()); - } - } - - public void release() { - try { - if (!this.isInit) { - DSLog.d(TAG, "AACEncode is not init"); - return; - } - this.mediaCodec.stop(); - this.mediaCodec.release(); - this.outputStream.flush(); - this.outputStream.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public byte[] encode(byte[] input) throws Exception { - if (!this.isInit) { - DSLog.d(TAG, "AACEncode is not init"); - return null; - } - DSLog.e(TAG, "encode:" + input.length + " is coming"); - int inputBufferIndex = this.mediaCodec.dequeueInputBuffer(-1L); - if (inputBufferIndex >= 0) { - ByteBuffer inputBuffer = this.inputBuffers[inputBufferIndex]; - inputBuffer.clear(); - inputBuffer.put(input); - inputBuffer.limit(input.length); - long pts = computePresentationTime(this.presentationTimeUs); - this.mediaCodec.queueInputBuffer(inputBufferIndex, 0, input.length, pts, 0); - this.presentationTimeUs++; - } - int dequeueOutputBuffer = this.mediaCodec.dequeueOutputBuffer(this.bufferInfo, 0L); - while (true) { - int outputBufferIndex = dequeueOutputBuffer; - if (outputBufferIndex >= 0) { - int outBitsSize = this.bufferInfo.size; - int outPacketSize = outBitsSize + 7; - ByteBuffer outputBuffer = this.outputBuffers[outputBufferIndex]; - outputBuffer.position(this.bufferInfo.offset); - outputBuffer.limit(this.bufferInfo.offset + outBitsSize); - byte[] outData = new byte[outPacketSize]; - addADTStoPacket(outData, outPacketSize); - outputBuffer.get(outData, 7, outBitsSize); - outputBuffer.position(this.bufferInfo.offset); - this.outputStream.write(outData); - DSLog.d(TAG, "encode:" + outData.length + " bytes written"); - this.mediaCodec.releaseOutputBuffer(outputBufferIndex, false); - dequeueOutputBuffer = this.mediaCodec.dequeueOutputBuffer(this.bufferInfo, 0L); - } else { - byte[] out = this.outputStream.toByteArray(); - this.outputStream.flush(); - this.outputStream.reset(); - return out; - } - } - } - - private void addADTStoPacket(byte[] packet, int packetLen) { - if (this.mAACAudioParam == null) { - this.mAACAudioParam = new AACAudioParam(); - } - int profile = this.mAACAudioParam.getProfile(); - int freqIdx = this.mAACAudioParam.getSample_frequency_index(); - int chanCfg = this.mAACAudioParam.getChannel_count(); - packet[0] = -1; - packet[1] = -7; - packet[2] = (byte) (((profile - 1) << 6) + (freqIdx << 2) + (chanCfg >> 2)); - packet[3] = (byte) (((chanCfg & 3) << 6) + (packetLen >> 11)); - packet[4] = (byte) ((packetLen & 2047) >> 3); - packet[5] = (byte) (((packetLen & 7) << 5) + 31); - packet[6] = -4; - } - - private long computePresentationTime(long frameIndex) { - if (this.mAACAudioParam == null) { - this.mAACAudioParam = new AACAudioParam(); - } - return ((frameIndex * 90000) * 1024) / this.mAACAudioParam.getSample_rate(); - } -} diff --git a/app/src/main/java/com/dowse/base/audio/AudioCapturer.java b/app/src/main/java/com/dowse/base/audio/AudioCapturer.java deleted file mode 100644 index b09d34fd..00000000 --- a/app/src/main/java/com/dowse/base/audio/AudioCapturer.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.dowse.base.audio; - -import android.annotation.SuppressLint; -import android.media.AudioRecord; -import android.os.SystemClock; -import android.util.Log; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/AudioCapturer.class */ -public class AudioCapturer { - private static final String TAG = "AudioCapturer"; - private static final int DEFAULT_SOURCE = 1; - private static final int DEFAULT_SAMPLE_RATE = 8000; - private static final int DEFAULT_CHANNEL_CONFIG = 16; - private static final int DEFAULT_AUDIO_FORMAT = 2; - private AudioRecord mAudioRecord; - private Thread mCaptureThread; - private OnAudioFrameCapturedListener mAudioFrameCapturedListener; - private int mMinBufferSize = 0; - private boolean mIsCaptureStarted = false; - private volatile boolean mIsLoopExit = false; - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/AudioCapturer$OnAudioFrameCapturedListener.class */ - public interface OnAudioFrameCapturedListener { - void onAudioFrameCaptured(byte[] bArr); - } - - public boolean isCaptureStarted() { - return this.mIsCaptureStarted; - } - - public void setOnAudioFrameCapturedListener(OnAudioFrameCapturedListener listener) { - this.mAudioFrameCapturedListener = listener; - } - - public boolean startCapture() { - return startCapture(1, DEFAULT_SAMPLE_RATE, DEFAULT_CHANNEL_CONFIG, 2); - } - - @SuppressLint({"MissingPermission"}) - public boolean startCapture(int audioSource, int sampleRateInHz, int channelConfig, int audioFormat) { - if (this.mIsCaptureStarted) { - Log.e(TAG, "Capture already started !"); - return false; - } - this.mMinBufferSize = AudioRecord.getMinBufferSize(sampleRateInHz, channelConfig, audioFormat); - if (this.mMinBufferSize == -2) { - Log.e(TAG, "Invalid parameter !"); - return false; - } - Log.d(TAG, "getMinBufferSize = " + this.mMinBufferSize + " bytes !"); - this.mAudioRecord = new AudioRecord(audioSource, sampleRateInHz, channelConfig, audioFormat, this.mMinBufferSize); - if (this.mAudioRecord.getState() == 0) { - Log.e(TAG, "AudioRecord initialize fail !"); - return false; - } - this.mAudioRecord.startRecording(); - this.mIsLoopExit = false; - this.mCaptureThread = new Thread(new AudioCaptureRunnable()); - this.mCaptureThread.start(); - this.mIsCaptureStarted = true; - Log.d(TAG, "Start audio capture success !"); - return true; - } - - public boolean stopCapture() { - if (!this.mIsCaptureStarted) { - return false; - } - this.mIsLoopExit = true; - try { - this.mCaptureThread.interrupt(); - this.mCaptureThread.join(1000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - if (this.mAudioRecord.getRecordingState() == 3) { - this.mAudioRecord.stop(); - } - this.mAudioRecord.release(); - this.mIsCaptureStarted = false; - Log.d(TAG, "Stop audio capture success !"); - return true; - } - - /* JADX INFO: Access modifiers changed from: private */ - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/AudioCapturer$AudioCaptureRunnable.class */ - public class AudioCaptureRunnable implements Runnable { - private AudioCaptureRunnable() { - } - - @Override // java.lang.Runnable - public void run() { - while (!AudioCapturer.this.mIsLoopExit) { - byte[] buffer = new byte[AudioCapturer.this.mMinBufferSize]; - int ret = AudioCapturer.this.mAudioRecord.read(buffer, 0, AudioCapturer.this.mMinBufferSize); - if (ret == -3) { - Log.e(AudioCapturer.TAG, "Error ERROR_INVALID_OPERATION"); - } else if (ret != -2) { - if (AudioCapturer.this.mAudioFrameCapturedListener != null) { - AudioCapturer.this.mAudioFrameCapturedListener.onAudioFrameCaptured(buffer); - } - } else { - Log.e(AudioCapturer.TAG, "Error ERROR_BAD_VALUE"); - } - SystemClock.sleep(10L); - } - } - } -} diff --git a/app/src/main/java/com/dowse/base/audio/AudioPlayer.java b/app/src/main/java/com/dowse/base/audio/AudioPlayer.java deleted file mode 100644 index 4c0807ad..00000000 --- a/app/src/main/java/com/dowse/base/audio/AudioPlayer.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.dowse.base.audio; - -import android.media.AudioTrack; -import android.util.Log; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/AudioPlayer.class */ -public class AudioPlayer { - private static final String TAG = "AudioPlayer"; - private static final int DEFAULT_STREAM_TYPE = 3; - private static final int DEFAULT_SAMPLE_RATE = 8000; - private static final int DEFAULT_CHANNEL_CONFIG = 4; - private static final int DEFAULT_AUDIO_FORMAT = 2; - private static final int DEFAULT_PLAY_MODE = 1; - private boolean mIsPlayStarted = false; - private int mMinBufferSize = 0; - private AudioTrack mAudioTrack; - - public boolean startPlayer() { - return startPlayer(3, DEFAULT_SAMPLE_RATE, DEFAULT_CHANNEL_CONFIG, 2); - } - - public boolean startPlayer(int streamType, int sampleRateInHz, int channelConfig, int audioFormat) { - if (this.mIsPlayStarted) { - Log.e(TAG, "Player already started !"); - return false; - } - this.mMinBufferSize = AudioTrack.getMinBufferSize(sampleRateInHz, channelConfig, audioFormat); - if (this.mMinBufferSize == -2) { - Log.e(TAG, "Invalid parameter !"); - return false; - } - Log.d(TAG, "getMinBufferSize = " + this.mMinBufferSize + " bytes !"); - this.mAudioTrack = new AudioTrack(streamType, sampleRateInHz, channelConfig, audioFormat, this.mMinBufferSize, 1); - if (this.mAudioTrack.getState() == 0) { - Log.e(TAG, "AudioTrack initialize fail !"); - return false; - } - this.mIsPlayStarted = true; - Log.d(TAG, "Start audio player success !"); - return true; - } - - public int getMinBufferSize() { - return this.mMinBufferSize; - } - - public boolean stopPlayer() { - if (!this.mIsPlayStarted) { - return false; - } - if (this.mAudioTrack.getPlayState() == 3) { - this.mAudioTrack.stop(); - } - this.mAudioTrack.release(); - this.mIsPlayStarted = false; - Log.d(TAG, "Stop audio player success !"); - return true; - } - - public boolean play(byte[] audioData, int offsetInBytes, int sizeInBytes) { - if (!this.mIsPlayStarted) { - Log.e(TAG, "Player not started !"); - return false; - } else if (sizeInBytes < this.mMinBufferSize) { - Log.e(TAG, "audio data is not enough !"); - return false; - } else { - if (this.mAudioTrack.write(audioData, offsetInBytes, sizeInBytes) != sizeInBytes) { - Log.e(TAG, "Could not write all the samples to the audio device !"); - } - this.mAudioTrack.play(); - Log.d(TAG, "OK, Played " + sizeInBytes + " bytes !"); - return true; - } - } -} diff --git a/app/src/main/java/com/dowse/base/audio/DSAudioFrame.java b/app/src/main/java/com/dowse/base/audio/DSAudioFrame.java deleted file mode 100644 index 757c80fb..00000000 --- a/app/src/main/java/com/dowse/base/audio/DSAudioFrame.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.dowse.base.audio; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/DSAudioFrame.class */ -public class DSAudioFrame { - private int no; - private int len; - private byte[] data; - - public int getLen() { - return this.len; - } - - public byte[] getData() { - return this.data; - } - - public DSAudioFrame(byte[] srcData) { - this.len = srcData.length; - this.data = srcData; - } - - public int getNo() { - return this.no; - } - - public void setNo(int no) { - this.no = no; - } -} diff --git a/app/src/main/java/com/dowse/base/audio/DSAudioManager.java b/app/src/main/java/com/dowse/base/audio/DSAudioManager.java deleted file mode 100644 index 581bae8e..00000000 --- a/app/src/main/java/com/dowse/base/audio/DSAudioManager.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.dowse.base.audio; - -import com.dowse.base.audio.AudioCapturer; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/DSAudioManager.class */ -public class DSAudioManager implements AudioCapturer.OnAudioFrameCapturedListener { - private static final String TAG = "DSAudioManager"; - private static DSAudioManager instance; - private AudioCapturer mAudioCapturer; - private AudioPlayer mAudioPlayer; - private DSCircleQueue mDSCircleQueue; - - public static DSAudioManager getInstance() { - if (instance == null) { - instance = new DSAudioManager(); - } - return instance; - } - - private DSAudioManager() { - this.mAudioCapturer = null; - this.mAudioPlayer = null; - this.mAudioCapturer = new AudioCapturer(); - this.mAudioCapturer.setOnAudioFrameCapturedListener(this); - this.mAudioPlayer = new AudioPlayer(); - this.mDSCircleQueue = new DSCircleQueue(); - } - - public boolean startCapture() { - if (this.mAudioCapturer != null && !this.mAudioCapturer.isCaptureStarted()) { - return this.mAudioCapturer.startCapture(); - } - return false; - } - - public boolean stopCapture() { - if (this.mAudioCapturer != null && this.mAudioCapturer.isCaptureStarted()) { - return this.mAudioCapturer.stopCapture(); - } - return false; - } - - public boolean startPlayer() { - if (this.mAudioPlayer != null) { - return this.mAudioPlayer.startPlayer(); - } - return false; - } - - public boolean stopPlayer() { - if (this.mAudioPlayer != null) { - return this.mAudioPlayer.stopPlayer(); - } - return false; - } - - public boolean play(byte[] pcmData) { - if (this.mAudioPlayer != null) { - return this.mAudioPlayer.play(pcmData, 0, pcmData.length); - } - return false; - } - - @Override // com.dowse.base.audio.AudioCapturer.OnAudioFrameCapturedListener - public void onAudioFrameCaptured(byte[] audioData) { - if (this.mDSCircleQueue != null) { - this.mDSCircleQueue.add(new DSAudioFrame(G711Alaw.encode(audioData))); - } - } - - public DSElement getAudioFrame(int readIndex) { - DSElement element = null; - if (this.mDSCircleQueue != null) { - element = this.mDSCircleQueue.get(readIndex); - } - return element; - } -} diff --git a/app/src/main/java/com/dowse/base/audio/DSCircleQueue.java b/app/src/main/java/com/dowse/base/audio/DSCircleQueue.java deleted file mode 100644 index 61d6c5dd..00000000 --- a/app/src/main/java/com/dowse/base/audio/DSCircleQueue.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.dowse.base.audio; - -import java.util.Arrays; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/DSCircleQueue.class */ -public class DSCircleQueue { - private static final String TAG = "DSCircleQueue"; - private final int DEFAULT_SIZE = 100; - public int head_offset = 0; - public int capacity = 0; - public DSAudioFrame[] elementData = new DSAudioFrame[100]; - - public synchronized void add(DSAudioFrame element) { - int offset = this.head_offset % 100; - element.setNo(this.head_offset); - this.elementData[offset] = element; - this.head_offset++; - this.capacity++; - if (this.capacity > 100) { - this.capacity = 100; - } - } - - public synchronized void clear() { - Arrays.fill(this.elementData, (Object) null); - this.head_offset = 0; - this.capacity = 0; - } - - public synchronized DSElement get(int index) { - int offset; - DSElement element = new DSElement(); - int need_position = 0; - if (this.capacity <= 0) { - element.setRet(-1); - return element; - } - if (index < 0) { - need_position = 1; - } else if (index >= this.head_offset) { - element.setRet(-2); - return element; - } else if (index < this.head_offset - 100) { - element.setRet(-1); - return element; - } - element.setRet(0); - if (need_position == 1) { - offset = (this.head_offset - 1) % 100; - } else { - offset = index % 100; - } - element.setData(this.elementData[offset]); - return element; - } -} diff --git a/app/src/main/java/com/dowse/base/audio/DSElement.java b/app/src/main/java/com/dowse/base/audio/DSElement.java deleted file mode 100644 index 3e9de00e..00000000 --- a/app/src/main/java/com/dowse/base/audio/DSElement.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.dowse.base.audio; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/DSElement.class */ -public class DSElement { - private int ret; - private DSAudioFrame data; - - public int getRet() { - return this.ret; - } - - public void setRet(int ret) { - this.ret = ret; - } - - public DSAudioFrame getData() { - return this.data; - } - - public void setData(DSAudioFrame data) { - this.data = data; - } -} diff --git a/app/src/main/java/com/dowse/base/audio/G711Alaw.java b/app/src/main/java/com/dowse/base/audio/G711Alaw.java deleted file mode 100644 index d113e0a0..00000000 --- a/app/src/main/java/com/dowse/base/audio/G711Alaw.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.dowse.base.audio; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/audio/G711Alaw.class */ -public class G711Alaw { - private static final int cClip = 32635; - private static short[] aLawDecompressTable = {-5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784, -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368, -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944, -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136, -11008, -10496, -12032, -11520, -8960, -8448, -9984, -9472, -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568, -344, -328, -376, -360, -280, -264, -312, -296, -472, -456, -504, -488, -408, -392, -440, -424, -88, -72, -120, -104, -24, -8, -56, -40, -216, -200, -248, -232, -152, -136, -184, -168, -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184, -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696, -688, -656, -752, -720, -560, -528, -624, -592, -944, -912, -1008, -976, -816, -784, -880, -848, 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736, 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784, 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368, 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944, 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136, 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472, 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568, 344, 328, 376, 360, 280, 264, 312, 296, 472, 456, 504, 488, 408, 392, 440, 424, 88, 72, 120, 104, 24, 8, 56, 40, 216, 200, 248, 232, 152, 136, 184, 168, 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184, 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, 688, 656, 752, 720, 560, 528, 624, 592, 944, 912, 1008, 976, 816, 784, 880, 848}; - private static byte[] aLawCompressTable = {1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}; - - public static byte[] encode(byte[] b) { - int j = 0; - int count = b.length / 2; - byte[] res = new byte[count]; - for (int i = 0; i < count; i++) { - int i2 = j; - int j2 = j + 1; - j = j2 + 1; - short sample = (short) ((b[i2] & 255) | (b[j2] << 8)); - res[i] = linearToALawSample(sample); - } - return res; - } - - public static byte[] decode(byte[] b) { - int j = 0; - byte[] res = new byte[b.length * 2]; - for (byte b2 : b) { - short s = aLawDecompressTable[b2 & 255]; - int i = j; - int j2 = j + 1; - res[i] = (byte) s; - j = j2 + 1; - res[j2] = (byte) (s >> 8); - } - return res; - } - - private static byte linearToALawSample(short sample) { - int s; - int sign = ((sample ^ (-1)) >> 8) & 128; - if (sign != 128) { - sample = (short) (-sample); - } - if (sample > cClip) { - sample = cClip; - } - if (sample >= 256) { - byte b = aLawCompressTable[(sample >> 8) & 127]; - int mantissa = (sample >> (b + 3)) & 15; - s = (b << 4) | mantissa; - } else { - s = sample >> 4; - } - return (byte) (s ^ (sign ^ 85)); - } -} diff --git a/app/src/main/java/com/dowse/base/data/DS4GAPNInfo.java b/app/src/main/java/com/dowse/base/data/DS4GAPNInfo.java deleted file mode 100644 index 4383c7bf..00000000 --- a/app/src/main/java/com/dowse/base/data/DS4GAPNInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DS4GAPNInfo.class */ -public class DS4GAPNInfo { - private String apn = ""; - private String user = ""; - private String password = ""; - private String mcc = ""; - private String mnc = ""; - private int authtype = 0; - - public String getApn() { - return this.apn; - } - - public void setApn(String apn) { - this.apn = apn; - } - - public String getUser() { - return this.user; - } - - public void setUser(String user) { - this.user = user; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getMcc() { - return this.mcc; - } - - public void setMcc(String mcc) { - this.mcc = mcc; - } - - public String getMnc() { - return this.mnc; - } - - public void setMnc(String mnc) { - this.mnc = mnc; - } - - public int getAuthtype() { - return this.authtype; - } - - public void setAuthtype(int authtype) { - this.authtype = authtype; - } - - public String toString() { - return "DS4GAPNInfo{apn='" + this.apn + "', user='" + this.user + "', password='" + this.password + "', mcc='" + this.mcc + "', mnc='" + this.mnc + "', authtype=" + this.authtype + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/data/DS4GInfo.java b/app/src/main/java/com/dowse/base/data/DS4GInfo.java deleted file mode 100644 index e5097747..00000000 --- a/app/src/main/java/com/dowse/base/data/DS4GInfo.java +++ /dev/null @@ -1,135 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DS4GInfo.class */ -public class DS4GInfo { - private int netEnable; - private String ip; - private String imei; - private String operateName; - private String netType; - private String iccid; - private String apn; - private String user; - private String password; - private String mcc; - private String mnc; - private int authtype; - private int dBm; - private int level; - - public int getNetEnable() { - return this.netEnable; - } - - public void setNetEnable(int netEnable) { - this.netEnable = netEnable; - } - - public String getIp() { - return this.ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getImei() { - return this.imei; - } - - public void setImei(String imei) { - this.imei = imei; - } - - public String getOperateName() { - return this.operateName; - } - - public void setOperateName(String operateName) { - this.operateName = operateName; - } - - public String getNetType() { - return this.netType; - } - - public void setNetType(String netType) { - this.netType = netType; - } - - public String getIccid() { - return this.iccid; - } - - public void setIccid(String iccid) { - this.iccid = iccid; - } - - public String getApn() { - return this.apn; - } - - public void setApn(String apn) { - this.apn = apn; - } - - public String getUser() { - return this.user; - } - - public void setUser(String user) { - this.user = user; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getMcc() { - return this.mcc; - } - - public void setMcc(String mcc) { - this.mcc = mcc; - } - - public String getMnc() { - return this.mnc; - } - - public void setMnc(String mnc) { - this.mnc = mnc; - } - - public int getAuthtype() { - return this.authtype; - } - - public void setAuthtype(int authtype) { - this.authtype = authtype; - } - - public int getdBm() { - return this.dBm; - } - - public void setdBm(int dBm) { - this.dBm = dBm; - } - - public int getLevel() { - return this.level; - } - - public void setLevel(int level) { - this.level = level; - } - - public String toString() { - return "DS4GInfo{netEnable=" + this.netEnable + ", ip='" + this.ip + "', imei='" + this.imei + "', operateName='" + this.operateName + "', netType='" + this.netType + "', iccid='" + this.iccid + "', apn='" + this.apn + "', user='" + this.user + "', password='" + this.password + "', mcc='" + this.mcc + "', mnc='" + this.mnc + "', authtype=" + this.authtype + ", dBm=" + this.dBm + ", level=" + this.level + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/data/DSDeviceCustomInfo.java b/app/src/main/java/com/dowse/base/data/DSDeviceCustomInfo.java deleted file mode 100644 index ecbd416d..00000000 --- a/app/src/main/java/com/dowse/base/data/DSDeviceCustomInfo.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DSDeviceCustomInfo.class */ -public class DSDeviceCustomInfo { - private String deviceName; - private String deviceModel; - private String deviceVersion; - private String manufacturer; - private String manufacturerDate; - private String productionNo; - private String componentId; - - public String getDeviceName() { - return this.deviceName; - } - - public void setDeviceName(String deviceName) { - this.deviceName = deviceName; - } - - public String getDeviceModel() { - return this.deviceModel; - } - - public void setDeviceModel(String deviceModel) { - this.deviceModel = deviceModel; - } - - public String getDeviceVersion() { - return this.deviceVersion; - } - - public void setDeviceVersion(String deviceVersion) { - this.deviceVersion = deviceVersion; - } - - public String getManufacturer() { - return this.manufacturer; - } - - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - - public String getManufacturerDate() { - return this.manufacturerDate; - } - - public void setManufacturerDate(String manufacturerDate) { - this.manufacturerDate = manufacturerDate; - } - - public String getProductionNo() { - return this.productionNo; - } - - public void setProductionNo(String productionNo) { - this.productionNo = productionNo; - } - - public String getComponentId() { - return this.componentId; - } - - public void setComponentId(String componentId) { - this.componentId = componentId; - } - - public String toString() { - return "DSDeviceCustomInfo{deviceName='" + this.deviceName + "', deviceModel='" + this.deviceModel + "', deviceVersion='" + this.deviceVersion + "', manufacturer='" + this.manufacturer + "', manufacturerDate='" + this.manufacturerDate + "', productionNo='" + this.productionNo + "', componentId='" + this.componentId + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/data/DSDeviceInfo.java b/app/src/main/java/com/dowse/base/data/DSDeviceInfo.java deleted file mode 100644 index db2bbd1d..00000000 --- a/app/src/main/java/com/dowse/base/data/DSDeviceInfo.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DSDeviceInfo.class */ -public class DSDeviceInfo { - private String model; - private String serial_no; - private String version; - private int camera_v_code; - private String camera_v_name; - private int i1_v_code; - private String i1_v_name; - private int i1_master_v_code; - private String i1_master_v_name; - private long systemTime; - private String hard_ver; - - public String getModel() { - return this.model; - } - - public void setModel(String model) { - this.model = model; - } - - public String getSerial_no() { - return this.serial_no; - } - - public void setSerial_no(String serial_no) { - this.serial_no = serial_no; - } - - public String getVersion() { - return this.version; - } - - public void setVersion(String version) { - this.version = version; - } - - public int getCamera_v_code() { - return this.camera_v_code; - } - - public void setCamera_v_code(int camera_v_code) { - this.camera_v_code = camera_v_code; - } - - public String getCamera_v_name() { - return this.camera_v_name; - } - - public void setCamera_v_name(String camera_v_name) { - this.camera_v_name = camera_v_name; - } - - public int getI1_v_code() { - return this.i1_v_code; - } - - public void setI1_v_code(int i1_v_code) { - this.i1_v_code = i1_v_code; - } - - public String getI1_v_name() { - return this.i1_v_name; - } - - public void setI1_v_name(String i1_v_name) { - this.i1_v_name = i1_v_name; - } - - public int getI1_master_v_code() { - return this.i1_master_v_code; - } - - public void setI1_master_v_code(int i1_master_v_code) { - this.i1_master_v_code = i1_master_v_code; - } - - public String getI1_master_v_name() { - return this.i1_master_v_name; - } - - public void setI1_master_v_name(String i1_master_v_name) { - this.i1_master_v_name = i1_master_v_name; - } - - public long getSystemTime() { - return this.systemTime; - } - - public void setSystemTime(long systemTime) { - this.systemTime = systemTime; - } - - public String getHard_ver() { - return this.hard_ver; - } - - public void setHard_ver(String hard_ver) { - this.hard_ver = hard_ver; - } - - public String toString() { - return "DSDeviceInfo{model='" + this.model + "', serial_no='" + this.serial_no + "', version='" + this.version + "', camera_v_code=" + this.camera_v_code + ", camera_v_name='" + this.camera_v_name + "', i1_v_code=" + this.i1_v_code + ", i1_v_name='" + this.i1_v_name + "', i1_master_v_code=" + this.i1_master_v_code + ", i1_master_v_name='" + this.i1_master_v_name + "', systemTime=" + this.systemTime + ", hard_ver='" + this.hard_ver + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/data/DSLocation.java b/app/src/main/java/com/dowse/base/data/DSLocation.java deleted file mode 100644 index 15cf9883..00000000 --- a/app/src/main/java/com/dowse/base/data/DSLocation.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.dowse.base.data; - -import android.location.Location; -import com.dowse.base.log.DSLog; -import java.math.BigDecimal; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DSLocation.class */ -public class DSLocation { - private static final String TAG = "DSLocation"; - private int is_open; - private int longitude; - private int latitude; - - public int getIs_open() { - return this.is_open; - } - - public void setIs_open(int is_open) { - this.is_open = is_open; - } - - public int getLongitude() { - return this.longitude; - } - - public void setLongitude(int longitude) { - this.longitude = longitude; - } - - public int getLatitude() { - return this.latitude; - } - - public void setLatitude(int latitude) { - this.latitude = latitude; - } - - public DSLocation(int is_open, Location location) { - this.is_open = is_open; - if (location != null) { - this.longitude = getIntValue(location.getLongitude()); - this.latitude = getIntValue(location.getLatitude()); - return; - } - this.longitude = 0; - this.latitude = 0; - } - - public DSLocation() { - } - - private int getIntValue(double number) { - int du = (int) Math.floor(Math.abs(number)); - double temp = get_point(Math.abs(number)) * 60.0d; - int fen = (int) Math.floor(temp); - double miao = get_point(temp) * 60.0d; - DSLog.d(TAG, "number=" + number + ",du=" + du + ",fen=" + fen + ",miao=" + miao); - return (du * 3600 * 100) + (fen * 60 * 100) + (((int) miao) * 100); - } - - private double get_point(double num) { - int fInt = (int) num; - BigDecimal b1 = new BigDecimal(Double.toString(num)); - BigDecimal b2 = new BigDecimal(Integer.toString(fInt)); - double dPoint = b1.subtract(b2).floatValue(); - return dPoint; - } - - public String toString() { - return "DSLocation{is_open=" + this.is_open + ", longitude=" + this.longitude + ", latitude=" + this.latitude + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/data/DSTFInfo.java b/app/src/main/java/com/dowse/base/data/DSTFInfo.java deleted file mode 100644 index d4f5ebd9..00000000 --- a/app/src/main/java/com/dowse/base/data/DSTFInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DSTFInfo.class */ -public class DSTFInfo { - private int sdExsit; - private int usbExsit; - private long sdTotal; - private long sdLeft; - private long usbTotal; - private long usbLeft; - - public int getSdExsit() { - return this.sdExsit; - } - - public void setSdExsit(int sdExsit) { - this.sdExsit = sdExsit; - } - - public int getUsbExsit() { - return this.usbExsit; - } - - public void setUsbExsit(int usbExsit) { - this.usbExsit = usbExsit; - } - - public long getSdTotal() { - return this.sdTotal; - } - - public void setSdTotal(long sdTotal) { - this.sdTotal = sdTotal; - } - - public long getSdLeft() { - return this.sdLeft; - } - - public void setSdLeft(long sdLeft) { - this.sdLeft = sdLeft; - } - - public long getUsbTotal() { - return this.usbTotal; - } - - public void setUsbTotal(long usbTotal) { - this.usbTotal = usbTotal; - } - - public long getUsbLeft() { - return this.usbLeft; - } - - public void setUsbLeft(long usbLeft) { - this.usbLeft = usbLeft; - } - - public String toString() { - return "DSTFInfo{sdExsit=" + this.sdExsit + ", usbExsit=" + this.usbExsit + ", sdTotal=" + this.sdTotal + ", sdLeft=" + this.sdLeft + ", usbTotal=" + this.usbTotal + ", usbLeft=" + this.usbLeft + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/data/DSWIFIAPInfo.java b/app/src/main/java/com/dowse/base/data/DSWIFIAPInfo.java deleted file mode 100644 index 066fa93c..00000000 --- a/app/src/main/java/com/dowse/base/data/DSWIFIAPInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DSWIFIAPInfo.class */ -public class DSWIFIAPInfo { - private int enable; - private int status; - private String ssid; - private String password; - - public int getEnable() { - return this.enable; - } - - public void setEnable(int enable) { - this.enable = enable; - } - - public int getStatus() { - return this.status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getSsid() { - return this.ssid; - } - - public void setSsid(String ssid) { - this.ssid = ssid; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String toString() { - return "DSWIFIAPInfo{enable=" + this.enable + ", status=" + this.status + ", ssid='" + this.ssid + "', password='" + this.password + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/data/DSWIFIInfo.java b/app/src/main/java/com/dowse/base/data/DSWIFIInfo.java deleted file mode 100644 index 3ee8fc65..00000000 --- a/app/src/main/java/com/dowse/base/data/DSWIFIInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/DSWIFIInfo.class */ -public class DSWIFIInfo { - private int enable; - private String ssid; - private String ip; - private String password; - - public int getEnable() { - return this.enable; - } - - public void setEnable(int enable) { - this.enable = enable; - } - - public String getSsid() { - return this.ssid; - } - - public void setSsid(String ssid) { - this.ssid = ssid; - } - - public String getIp() { - return this.ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String toString() { - return "DSWIFIInfo{enable=" + this.enable + ", ssid='" + this.ssid + "', ip='" + this.ip + "', password='" + this.password + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/data/StaticIPInfo.java b/app/src/main/java/com/dowse/base/data/StaticIPInfo.java deleted file mode 100644 index 85cb820c..00000000 --- a/app/src/main/java/com/dowse/base/data/StaticIPInfo.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.dowse.base.data; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/data/StaticIPInfo.class */ -public class StaticIPInfo { - private String ip; - private String mac; - private String mask; - private String gw; - private String dns1; - private String dns2; - - public String getIp() { - return this.ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getMac() { - return this.mac; - } - - public void setMac(String mac) { - this.mac = mac; - } - - public String getMask() { - return this.mask; - } - - public void setMask(String mask) { - this.mask = mask; - } - - public String getGw() { - return this.gw; - } - - public void setGw(String gw) { - this.gw = gw; - } - - public String getDns1() { - return this.dns1; - } - - public void setDns1(String dns1) { - this.dns1 = dns1; - } - - public String getDns2() { - return this.dns2; - } - - public void setDns2(String dns2) { - this.dns2 = dns2; - } - - public String toString() { - return "StaticIPInfo{ip='" + this.ip + "', mac='" + this.mac + "', mask='" + this.mask + "', gw='" + this.gw + "', dns1='" + this.dns1 + "', dns2='" + this.dns2 + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/log/ByteTools.java b/app/src/main/java/com/dowse/base/log/ByteTools.java deleted file mode 100644 index f261dfdb..00000000 --- a/app/src/main/java/com/dowse/base/log/ByteTools.java +++ /dev/null @@ -1,443 +0,0 @@ -package com.dowse.base.log; - -import android.text.TextUtils; -import com.dowse.base.param.device.DeviceConst; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/log/ByteTools.class */ -public class ByteTools { - public static float bytesToFloat(byte[] b, int index) { - int l = b[index + 3] << 0; - return Float.intBitsToFloat((int) ((((int) ((((int) ((l & 255) | (b[index + 2] << 8))) & 65535) | (b[index + 1] << 16))) & 16777215) | (b[index + 0] << 24))); - } - - public static int bytesToInt(List bytes) { - if (bytes == null || bytes.size() == 0) { - return 0; - } - if (bytes.size() == 1) { - return bytes.get(0).byteValue(); - } - if (bytes.size() == 2) { - return (65280 & (bytes.get(1).byteValue() << 8)) | (255 & bytes.get(0).byteValue()); - } - if (bytes.size() == 3) { - return (16711680 & (bytes.get(2).byteValue() << 16)) | (65280 & (bytes.get(1).byteValue() << 8)) | (255 & bytes.get(0).byteValue()); - } - if (bytes.size() == 4) { - return ((-16777216) & (bytes.get(3).byteValue() << 24)) | (16711680 & (bytes.get(2).byteValue() << 16)) | (65280 & (bytes.get(1).byteValue() << 8)) | (255 & bytes.get(0).byteValue()); - } - return 0; - } - - public static int bytesToIntBigEndian(List bytes) { - if (bytes == null || bytes.size() == 0) { - return 0; - } - if (bytes.size() == 1) { - return bytes.get(0).byteValue(); - } - if (bytes.size() == 2) { - return (65280 & (bytes.get(0).byteValue() << 8)) | (255 & bytes.get(1).byteValue()); - } - if (bytes.size() == 3) { - return (16711680 & (bytes.get(0).byteValue() << 16)) | (65280 & (bytes.get(1).byteValue() << 8)) | (255 & bytes.get(2).byteValue()); - } - if (bytes.size() == 4) { - return ((-16777216) & (bytes.get(0).byteValue() << 24)) | (16711680 & (bytes.get(1).byteValue() << 16)) | (65280 & (bytes.get(2).byteValue() << 8)) | (255 & bytes.get(3).byteValue()); - } - return 0; - } - - public static char byteToChar(byte b) { - char c = (char) (0 | (255 & b)); - return c; - } - - public static String bytesToString(List b) { - return ((char) (0 | (255 & b.get(0).byteValue()))) + "" + ((char) (0 | (255 & b.get(1).byteValue()))) + "" + ((char) (0 | (255 & b.get(2).byteValue()))) + "" + ((char) (0 | (255 & b.get(3).byteValue()))); - } - - public static double bytesToDouble(byte[] arr, int index) { - long value = 0; - int index2 = index + 7; - for (int i = 0; i < 8; i++) { - value |= (arr[index2 - i] & 255) << (8 * i); - } - return Double.longBitsToDouble(value); - } - - public static long bytes2long(byte[] bs) { - int bytes = bs.length; - switch (bytes) { - case 1: - return bs[0] & 255; - case 2: - return ((bs[0] & 255) << 8) | (bs[1] & 255); - case DeviceConst.SYSTEM_REBOOT /* 3 */: - return ((bs[0] & 255) << 16) | ((bs[1] & 255) << 8) | (bs[2] & 255); - case 4: - return ((bs[0] & 255) << 24) | ((bs[1] & 255) << 16) | ((bs[2] & 255) << 8) | (bs[3] & 255); - case 5: - return ((bs[0] & 255) << 32) | ((bs[1] & 255) << 24) | ((bs[2] & 255) << 16) | ((bs[3] & 255) << 8) | (bs[4] & 255); - case 6: - return ((bs[0] & 255) << 40) | ((bs[1] & 255) << 32) | ((bs[2] & 255) << 24) | ((bs[3] & 255) << 16) | ((bs[4] & 255) << 8) | (bs[5] & 255); - case 7: - return ((bs[0] & 255) << 48) | ((bs[1] & 255) << 40) | ((bs[2] & 255) << 32) | ((bs[3] & 255) << 24) | ((bs[4] & 255) << 16) | ((bs[5] & 255) << 8) | (bs[6] & 255); - case 8: - return ((bs[0] & 255) << 56) | ((bs[1] & 255) << 48) | ((bs[2] & 255) << 40) | ((bs[3] & 255) << 32) | ((bs[4] & 255) << 24) | ((bs[5] & 255) << 16) | ((bs[6] & 255) << 8) | (bs[7] & 255); - default: - return 0L; - } - } - - public static String bytesToString(byte[] content, int offset, int length) { - int effLength = checkEffectiveLength(content, offset, length); - return new String(content, offset, effLength); - } - - public static int checkEffectiveLength(byte[] content, int offset, int length) { - for (int i = 0; i < length; i++) { - try { - int v = content[offset + i] & 255; - if (v == 0) { - return i; - } - } catch (Exception e) { - e.printStackTrace(); - return 0; - } - } - return 0; - } - - public static byte[] hexStringToByteArray(String hexString) { - try { - if (!TextUtils.isEmpty(hexString)) { - int len = hexString.length(); - byte[] bytes = new byte[len / 2]; - for (int index = 0; index < len; index += 2) { - String sub = hexString.substring(index, index + 2); - bytes[index / 2] = (byte) Integer.parseInt(sub, 16); - } - return bytes; - } - return new byte[0]; - } catch (Exception e) { - e.printStackTrace(); - return new byte[0]; - } - } - - public static byte[] shortToBytes(short value) { - byte[] temp = {(byte) (value & 255), (byte) ((value >> 8) & 65280)}; - return temp; - } - - public static byte[] longToBytes(long num) { - byte[] byteNum = new byte[8]; - for (int ix = 0; ix < 8; ix++) { - int offset = 64 - ((ix + 1) * 8); - byteNum[ix] = (byte) ((num >> offset) & 255); - } - return byteNum; - } - - public static byte[] doubleToBytes(double d) { - long value = Double.doubleToRawLongBits(d); - byte[] byteRet = new byte[8]; - for (int i = 0; i < 8; i++) { - byteRet[i] = (byte) ((value >> (8 * i)) & 255); - } - return byteRet; - } - - public static double bytesToDouble1(byte[] arr, int index) { - long value = 0; - for (int i = 0; i < 8; i++) { - value |= (arr[index + i] & 255) << (8 * i); - } - return Double.longBitsToDouble(value); - } - - public static void intToBytes4(int value, List data) { - data.set(0, Byte.valueOf((byte) value)); - data.set(1, Byte.valueOf((byte) (value >> 8))); - data.set(2, Byte.valueOf((byte) (value >> 16))); - data.set(3, Byte.valueOf((byte) (value >> 24))); - } - - public static void intToBytes2(int value, List data) { - data.set(0, Byte.valueOf((byte) value)); - data.set(1, Byte.valueOf((byte) (value >> 8))); - } - - public static byte[] intToBytes4(int value) { - byte[] b = {(byte) value, (byte) (value >> 8), (byte) (value >> 16), (byte) (value >> 24)}; - return b; - } - - public static int bytesToInt1(byte[] bytes, int index) { - return ((-16777216) & (bytes[index + 3] << 24)) | (16711680 & (bytes[index + 2] << 16)) | (65280 & (bytes[index + 1] << 8)) | (255 & bytes[index + 0]); - } - - public static byte[] getByteArray(float f) { - int intbits = Float.floatToIntBits(f); - return getByteArray(intbits); - } - - public static void floatToBytes4(float f, List data) { - byte[] ret = floatToBytes4(f); - if (ret != null && data != null && ret.length == 4 && data.size() >= 4) { - data.set(0, Byte.valueOf(ret[0])); - data.set(1, Byte.valueOf(ret[1])); - data.set(2, Byte.valueOf(ret[2])); - data.set(3, Byte.valueOf(ret[3])); - } - } - - public static byte[] floatToBytes4(float f) { - int fbit = Float.floatToIntBits(f); - byte[] b = new byte[4]; - for (int i = 0; i < 4; i++) { - b[i] = (byte) (fbit >> (24 - (i * 8))); - } - int len = b.length; - byte[] dest = new byte[len]; - System.arraycopy(b, 0, dest, 0, len); - for (int i2 = 0; i2 < len / 2; i2++) { - byte temp = dest[i2]; - dest[i2] = dest[(len - i2) - 1]; - dest[(len - i2) - 1] = temp; - } - return dest; - } - - public static float bytesToFloat1(byte[] b, int index) { - int l = b[index + 0] & 255; - return Float.intBitsToFloat((int) ((((int) ((((int) (l | (b[index + 1] << 8))) & 65535) | (b[index + 2] << 16))) & 16777215) | (b[index + 3] << 24))); - } - - public static int getFlagFromByte(byte data, int position) { - int result; - switch (position) { - case 1: - result = data & 1; - break; - case 2: - result = data & 2; - break; - case DeviceConst.SYSTEM_REBOOT /* 3 */: - result = data & 4; - break; - case 4: - result = data & 8; - break; - case 5: - result = data & 16; - break; - case 6: - result = data & 32; - break; - case 7: - result = data & 64; - break; - case 8: - result = data & 128; - break; - default: - result = 0; - break; - } - if (result > 0) { - return 1; - } - return 0; - } - - public static void int2Byte4(int i, List byteList) { - if (byteList == null || byteList.size() < 4) { - return; - } - byteList.set(0, Byte.valueOf((byte) ((i >> 24) & 255))); - byteList.set(1, Byte.valueOf((byte) ((i >> 16) & 255))); - byteList.set(2, Byte.valueOf((byte) ((i >> 8) & 255))); - byteList.set(3, Byte.valueOf((byte) ((i >> 0) & 255))); - } - - public static void int2Byte1(int value, List byteList) { - if (byteList == null || byteList.size() < 1) { - return; - } - byteList.set(0, Byte.valueOf((byte) value)); - } - - public static void int2Byte2(int i, List byteList) { - if (byteList == null || byteList.size() < 2) { - return; - } - byteList.set(0, Byte.valueOf((byte) ((i >> 8) & 255))); - byteList.set(1, Byte.valueOf((byte) ((i >> 0) & 255))); - } - - public static void int2Byte3(int i, List byteList) { - if (byteList == null || byteList.size() < 3) { - return; - } - byteList.set(0, Byte.valueOf((byte) ((i >> 16) & 255))); - byteList.set(1, Byte.valueOf((byte) ((i >> 8) & 255))); - byteList.set(2, Byte.valueOf((byte) ((i >> 0) & 255))); - } - - public static byte[] int2ByteArray(int i) { - byte[] result = {(byte) ((i >> 24) & 255), (byte) ((i >> 16) & 255), (byte) ((i >> 8) & 255), (byte) (i & 255)}; - return result; - } - - public static int byteArray2Int(byte[] bytes) { - int value = 0; - for (int i = 0; i < 4; i++) { - int shift = (3 - i) * 8; - value += (bytes[i] & 255) << shift; - } - return value; - } - - public static byte[] int2TwoLenByteArray(int value) { - if (value > 32767) { - return null; - } - byte[] ret = {(byte) ((value >> 8) & 255), (byte) (value & 255)}; - return ret; - } - - public static byte[] list2byte(List list) { - if (list == null || list.size() < 0) { - return null; - } - byte[] bytes = new byte[list.size()]; - int i = 0; - for (Byte b : list) { - bytes[i] = b.byteValue(); - i++; - } - return bytes; - } - - public static void addByteArrayToList(List list, byte[] bytes) { - for (int i = 0; i < bytes.length; i++) { - if (list instanceof ArrayList) { - list.add(Byte.valueOf(bytes[i])); - } else { - list.set(i, Byte.valueOf(bytes[i])); - } - } - } - - public static void addIntArrayToList(List list, int[] bytes) { - for (int i = 0; i < bytes.length; i++) { - if (list instanceof ArrayList) { - list.add(Byte.valueOf((byte) bytes[i])); - } else { - list.set(i, Byte.valueOf((byte) bytes[i])); - } - } - } - - public static byte[] stringToByteArrayWithArrayLen(String str, int arraysLen) { - byte[] dataToByte = str.getBytes(); - if (dataToByte.length > arraysLen) { - return null; - } - byte[] ret = new byte[arraysLen]; - for (int i = 0; i < dataToByte.length; i++) { - ret[i] = dataToByte[i]; - } - for (int i2 = dataToByte.length; i2 < arraysLen; i2++) { - ret[i2] = 32; - } - return ret; - } - - public static void stringToFixLengthByteList(String data, List list, int length) { - if (data == null || data.length() < length || list == null) { - return; - } - byte[] dataToByte = data.getBytes(StandardCharsets.UTF_8); - for (int i = 0; i < length; i++) { - list.set(i, Byte.valueOf(dataToByte[i])); - } - } - - public static String byteToHexStr(byte[] bytes) { - if (bytes == null || bytes.length <= 0) { - return ""; - } - StringBuilder sb = new StringBuilder(""); - for (byte b : bytes) { - String strHex = Integer.toHexString(b & 255); - if (strHex.length() == 1) { - strHex = "0" + strHex; - } - sb.append(strHex + " "); - } - return sb.toString().trim(); - } - - public static String byteToHexStr(byte bytes) { - StringBuilder sb = new StringBuilder(""); - String strHex = Integer.toHexString(bytes & 255); - if (strHex.length() == 1) { - strHex = "0" + strHex; - } - sb.append(strHex + " "); - return sb.toString().trim(); - } - - public static String byteToHexStr3(List bytes) { - if (bytes == null || bytes.size() <= 0) { - return ""; - } - StringBuilder sb = new StringBuilder(""); - for (int n = 0; n < bytes.size(); n++) { - String strHex = "00"; - if (bytes.get(n) != null) { - strHex = Integer.toHexString(bytes.get(n).byteValue() & 255); - } - if (strHex.length() == 1) { - strHex = "0" + strHex; - } - sb.append(strHex + " "); - } - return sb.toString().trim(); - } - - public static String byteToHexStr2(byte[] bytes) { - if (bytes == null || bytes.length <= 0) { - return ""; - } - StringBuilder sb = new StringBuilder(""); - for (byte b : bytes) { - String strHex = Integer.toHexString(b & 255); - sb.append(strHex.length() == 1 ? "0" + strHex : strHex); - } - return sb.toString().trim(); - } - - public static void fix0WhenNull(List list) { - for (int i = 0; i < list.size(); i++) { - if (list.get(i) == null) { - list.set(i, (byte) 0); - } - } - } - - public static void test1() { - byte[] aa = {-106, 1, 17, -111}; - DSLog.d("lyp", "a0=" + ((int) aa[0])); - DSLog.d("lyp", "a1=" + ((int) aa[1])); - DSLog.bytesNotSaveFile("lyp", "a=", aa); - } -} diff --git a/app/src/main/java/com/dowse/base/log/Const.java b/app/src/main/java/com/dowse/base/log/Const.java deleted file mode 100644 index 7de25c38..00000000 --- a/app/src/main/java/com/dowse/base/log/Const.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.dowse.base.log; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/log/Const.class */ -public interface Const { - public static final String DEFAULT_LOG_PATH = "/sdcard/apps/log/"; -} diff --git a/app/src/main/java/com/dowse/base/log/DSLog.java b/app/src/main/java/com/dowse/base/log/DSLog.java deleted file mode 100644 index 3728e012..00000000 --- a/app/src/main/java/com/dowse/base/log/DSLog.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.dowse.base.log; - -import android.util.Log; -import com.dowse.base.util.ContextUtil; -import com.dowse.base.util.MD5Util; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/log/DSLog.class */ -public class DSLog { - private static final int MAX_SIZE_MB = 10; - private static final String VERBOSE = "verbose"; - private static final String DEBUG = "debug"; - private static final String INFO = "info"; - private static final String WARN = "warn"; - private static final String ERROR = "error"; - private static String APP_NAME = "unknown"; - private static boolean is_open = true; - private static List logList; - - public static void closeLog() { - is_open = false; - } - - public static void bytesW(String tag, String msgInfo, byte[] data) { - if (data == null || data.length <= 0) { - return; - } - String str = msgInfo + " " + ByteTools.byteToHexStr(data); - if (str != null && str.length() > 300) { - str = str.substring(0, 300) + " ...."; - } - v(tag, str); - } - - public static void bytesNotSaveFile(String tag, String msgInfo, byte[] data) { - String byteStr; - if (data == null || data.length <= 0) { - Log.d(tag, msgInfo + " data is null"); - return; - } - if (data.length > 500) { - byteStr = " 图片视频的数据报文,不打印 "; - } else { - byteStr = ByteTools.byteToHexStr(data); - } - Log.d(tag, msgInfo + " " + byteStr); - } - - public static void bytesNotSaveFile(String tag, String msgInfo, List data) { - if (data == null || data.size() <= 0) { - Log.d(tag, msgInfo + " data is null"); - return; - } - String str = msgInfo + " " + ByteTools.byteToHexStr3(data); - if (str != null && str.length() > 200) { - str = str.substring(0, 200) + " ...."; - } - Log.d(tag, str); - } - - public static void v(String tag, String msg) { - if (is_open) { - Log.v(tag, msg); - writeLogfile(tag, msg, VERBOSE); - } - } - - public static void dNotFile(String tag, String msg) { - if (is_open) { - Log.d(tag, msg); - } - } - - public static void d(String tag, String msg) { - if (is_open) { - Log.d(tag, msg); - writeLogfile(tag, msg, "debug"); - } - } - - public static void i(String tag, String msg) { - if (is_open) { - Log.i(tag, msg); - writeLogfile(tag, msg, INFO); - } - } - - public static void w(String tag, String msg) { - if (is_open) { - Log.w(tag, msg); - writeLogfile(tag, msg, WARN); - } - } - - public static void e(String tag, String msg) { - if (is_open) { - Log.e(tag, msg); - writeLogfile(tag, msg, ERROR); - } - } - - private static void showLog2Views(String content) { - synchronized (DSLog.class) { - if (content == null) { - return; - } - if (logList == null) { - logList = new ArrayList(); - } - logList.add(content); - if (logList.size() > 20) { - logList.remove(0); - } - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < logList.size(); i++) { - sb.append(logList.get(i)); - sb.append("\n"); - } - } - } - - private static void writeLogfile(String tag, String msg, String type) { - ThreadPoolTools.post(() -> { - writeLogfileInSubThread(tag, msg, type); - }); - } - - /* JADX INFO: Access modifiers changed from: private */ - public static void writeLogfileInSubThread(String tag, String msg, String type) { - if (APP_NAME.equals("unknown")) { - APP_NAME = MD5Util.md5(ContextUtil.getApplication().getPackageName()); - } - String logName = APP_NAME + ".log"; - SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss.SSS"); - String time = sdfTime.format(new Date(System.currentTimeMillis())); - String content = time + " " + tag + "/" + type + ": " + msg; - BufferedWriter out = null; - String fileDir = Const.DEFAULT_LOG_PATH + APP_NAME; - try { - try { - File dir = new File(fileDir); - if (!dir.exists()) { - dir.mkdirs(); - } - String filePath = fileDir + File.separator + logName; - File logFile = new File(filePath); - double logSizeMB = (logFile.length() / 1024) / 1024; - if (logSizeMB > 10.0d) { - logFile.delete(); - } - out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filePath, true))); - out.write(content); - out.write("\r\n"); - if (out != null) { - try { - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } catch (Exception e2) { - e2.printStackTrace(); - if (out != null) { - try { - out.close(); - } catch (IOException e3) { - e3.printStackTrace(); - } - } - } - } catch (Throwable th) { - if (out != null) { - try { - out.close(); - } catch (IOException e4) { - e4.printStackTrace(); - throw th; - } - } - throw th; - } - } -} diff --git a/app/src/main/java/com/dowse/base/log/FileTools.java b/app/src/main/java/com/dowse/base/log/FileTools.java deleted file mode 100644 index f8a95f10..00000000 --- a/app/src/main/java/com/dowse/base/log/FileTools.java +++ /dev/null @@ -1,214 +0,0 @@ -package com.dowse.base.log; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.nio.file.Files; -import java.nio.file.LinkOption; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.FileTime; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/log/FileTools.class */ -public class FileTools { - private static String TAG = "FileTools"; - - public static void createDefaultDirs(String path) { - File file = new File(path); - if (!file.exists()) { - file.mkdirs(); - } - if (file.exists() && !file.isDirectory()) { - file.delete(); - file.mkdirs(); - } - } - - public static int getFileLastModifiedTime(String filepath) { - File file = new File(filepath); - long time = file.lastModified(); - return (int) (time / 1000); - } - - public static long getFileCreateTime(String filePath) { - FileTime fileTime = null; - try { - fileTime = Files.readAttributes(Paths.get(filePath, new String[0]), BasicFileAttributes.class, new LinkOption[0]).creationTime(); - } catch (IOException e) { - e.printStackTrace(); - } - long time = fileTime.toMillis(); - return time; - } - - public static int getPartNumber(String filePath, int onePartLen) { - File file = new File(filePath); - if (!file.exists()) { - DSLog.e(TAG, filePath + " not exists -2- !!!"); - return -1; - } - long fileLength = 0; - try { - RandomAccessFile raf = new RandomAccessFile(file, "r"); - fileLength = raf.length(); - } catch (IOException e) { - e.printStackTrace(); - } - DSLog.d(TAG, " filePath == " + filePath + " len=" + fileLength); - if (fileLength <= 0) { - DSLog.e(TAG, "length is illegal!!!"); - return -1; - } - long totalParts = fileLength / onePartLen; - if (fileLength % onePartLen > 0) { - totalParts++; - } - DSLog.d(TAG, "文件分包- totalParts=" + totalParts + " filePath=" + filePath + " onePartLen=" + onePartLen + " fileLength=" + fileLength); - return (int) totalParts; - } - - public static byte[] getOneSampleDataFromFile(String filePath, int index, int onePacketLength) { - File file = new File(filePath); - if (!file.exists()) { - DSLog.e(TAG, filePath + " not exists!!! -3-"); - return null; - } - int bufferSize = onePacketLength; - RandomAccessFile raf = null; - byte[] buffer = null; - try { - try { - try { - raf = new RandomAccessFile(file, "r"); - int fileLen = (int) raf.length(); - if ((index + 1) * onePacketLength > fileLen) { - bufferSize = fileLen - (index * onePacketLength); - } - raf.seek(index * onePacketLength); - buffer = new byte[bufferSize]; - raf.read(buffer); - if (raf != null) { - try { - raf.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } catch (FileNotFoundException e2) { - e2.printStackTrace(); - if (raf != null) { - try { - raf.close(); - } catch (IOException e3) { - e3.printStackTrace(); - } - } - } - } catch (IOException e4) { - e4.printStackTrace(); - if (raf != null) { - try { - raf.close(); - } catch (IOException e5) { - e5.printStackTrace(); - } - } - } - return buffer; - } catch (Throwable th) { - if (raf != null) { - try { - raf.close(); - } catch (IOException e6) { - e6.printStackTrace(); - } - } - throw th; - } - } - - public static byte[] getByteDataFromFile(String filePath, long seekStart, int length) { - File file = new File(filePath); - if (!file.exists()) { - DSLog.e(TAG, filePath + " not exists!!! -4-"); - return null; - } - RandomAccessFile raf = null; - byte[] buffer = null; - try { - try { - raf = new RandomAccessFile(file, "r"); - raf.seek(seekStart); - buffer = new byte[length]; - raf.read(buffer); - if (raf != null) { - try { - raf.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } catch (FileNotFoundException e2) { - e2.printStackTrace(); - if (raf != null) { - try { - raf.close(); - } catch (IOException e3) { - e3.printStackTrace(); - } - } - } catch (IOException e4) { - e4.printStackTrace(); - if (raf != null) { - try { - raf.close(); - } catch (IOException e5) { - e5.printStackTrace(); - } - } - } - return buffer; - } catch (Throwable th) { - if (raf != null) { - try { - raf.close(); - } catch (IOException e6) { - e6.printStackTrace(); - } - } - throw th; - } - } - - public static void deleteFileByDay(File file, int day) { - deleteFileBySecond(file, day * 24 * 60 * 60); - } - - public static void deleteFileBySecond(File file, int seconds) { - if (file == null || seconds < 0) { - return; - } - File[] files = file.listFiles(); - if (files != null && files.length > 0) { - for (File f : files) { - if (f.isDirectory()) { - deleteFileBySecond(f, seconds); - } else { - int getModifiedTime = getFileLastModifiedTime(String.valueOf(f)); - long sec = seconds; - long m = (System.currentTimeMillis() / 1000) - sec; - if (m > getModifiedTime) { - DSLog.v(TAG, "del 文件 - " + file.getAbsolutePath()); - f.delete(); - } - } - } - return; - } - String path = file.getAbsolutePath() + "/"; - path.replace("//", "/"); - DSLog.v(TAG, "del 文件夹 - " + file.getAbsolutePath()); - file.delete(); - } -} diff --git a/app/src/main/java/com/dowse/base/log/FileWorks.java b/app/src/main/java/com/dowse/base/log/FileWorks.java deleted file mode 100644 index e53a8f18..00000000 --- a/app/src/main/java/com/dowse/base/log/FileWorks.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.dowse.base.log; - -import java.io.File; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/log/FileWorks.class */ -public class FileWorks { - public void doDelOverTimeFiles() { - ThreadPoolTools.post(() -> { - FileTools.deleteFileByDay(new File(Const.DEFAULT_LOG_PATH), 5); - }); - } -} diff --git a/app/src/main/java/com/dowse/base/log/ThreadPoolTools.java b/app/src/main/java/com/dowse/base/log/ThreadPoolTools.java deleted file mode 100644 index 0bdb2bf6..00000000 --- a/app/src/main/java/com/dowse/base/log/ThreadPoolTools.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.dowse.base.log; - -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/log/ThreadPoolTools.class */ -public class ThreadPoolTools { - private static final int MAX_THREAD = 3; - private static ExecutorService executorService; - private static ExecutorService single; - - private ThreadPoolTools() { - } - - public static void post(Runnable runnable) { - if (executorService != null && (executorService.isShutdown() || executorService.isTerminated())) { - executorService = null; - } - if (executorService == null) { - synchronized (ThreadPoolTools.class) { - if (executorService == null) { - executorService = Executors.newWorkStealingPool(3); - } - } - } - executorService.execute(runnable); - } - - public static void singleThread(Runnable runnable) { - if (single == null || single.isShutdown() || single.isTerminated()) { - synchronized (ThreadPoolTools.class) { - single = Executors.newSingleThreadExecutor(); - } - } - single.execute(runnable); - } -} diff --git a/app/src/main/java/com/dowse/base/manager/DS4GManager.java b/app/src/main/java/com/dowse/base/manager/DS4GManager.java deleted file mode 100644 index e16cc2dd..00000000 --- a/app/src/main/java/com/dowse/base/manager/DS4GManager.java +++ /dev/null @@ -1,439 +0,0 @@ -package com.dowse.base.manager; - -import android.content.ContentResolver; -import android.content.ContentValues; -import android.content.Context; -import android.database.Cursor; -import android.net.ConnectivityManager; -import android.net.Uri; -import android.os.Handler; -import android.telephony.PhoneStateListener; -import android.telephony.SignalStrength; -import android.telephony.SubscriptionInfo; -import android.telephony.SubscriptionManager; -import android.telephony.TelephonyManager; -import com.dowse.base.data.DS4GAPNInfo; -import com.dowse.base.data.DS4GInfo; -import com.dowse.base.log.DSLog; -import com.dowse.base.param.video.ChannelConst; -import com.dowse.base.util.ContextUtil; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; -import java.util.Enumeration; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DS4GManager.class */ -public class DS4GManager { - private static final String TAG = "DS4GManager"; - private static Uri APN_URI = Uri.parse("content://telephony/carriers"); - private static Uri CURRENT_APN_URI = Uri.parse("content://telephony/carriers/preferapn"); - private Context mContext; - private SignalStrength lastSignalStrength; - private Handler mHandler; - private static final int MAX_GET_SINGNAL_TIME = 60000; - private PhoneStateListener mSignalListener; - - /* JADX INFO: Access modifiers changed from: private */ - public synchronized void updateSignalStrength(SignalStrength signalStrength) { - this.lastSignalStrength = signalStrength; - } - - public static DS4GManager getInstance() { - return DS4GManagerHolder.instance; - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DS4GManager$DS4GManagerHolder.class */ - private static class DS4GManagerHolder { - public static final DS4GManager instance = new DS4GManager(); - - private DS4GManagerHolder() { - } - } - - private DS4GManager() { - this.mContext = null; - this.mSignalListener = new PhoneStateListener() { // from class: com.dowse.base.manager.DS4GManager.1 - @Override // android.telephony.PhoneStateListener - public void onSignalStrengthsChanged(SignalStrength signalStrength) { - super.onSignalStrengthsChanged(signalStrength); - DS4GManager.this.updateSignalStrength(signalStrength); - } - }; - this.mContext = ContextUtil.getApplication(); - this.mHandler = new Handler(); - update4GSignal(); - } - - public boolean hasSimCard() { - if (this.mContext != null) { - TelephonyManager telMgr = (TelephonyManager) this.mContext.getSystemService("phone"); - int simState = telMgr.getSimState(); - boolean result = true; - switch (simState) { - case ChannelConst.MTK_FACING_BACK /* 0 */: - case 1: - result = false; - break; - } - return result; - } - DSLog.e(TAG, "hasSimCard mContext is null!!!"); - return false; - } - - public synchronized SignalStrength getLatestSignalStrength() { - return this.lastSignalStrength; - } - - public void cleanSignalListener(PhoneStateListener listener) { - TelephonyManager mTelephonyManager; - if (this.mContext != null) { - if (hasSimCard() && (mTelephonyManager = (TelephonyManager) this.mContext.getSystemService("phone")) != null) { - mTelephonyManager.listen(listener, 0); - return; - } - return; - } - DSLog.e(TAG, "cleanSignalListener mContext is null!!!"); - } - - public void getSignal(PhoneStateListener listener) { - TelephonyManager mTelephonyManager; - if (this.mContext != null) { - if (hasSimCard() && (mTelephonyManager = (TelephonyManager) this.mContext.getSystemService("phone")) != null) { - mTelephonyManager.listen(listener, 256); - return; - } - return; - } - DSLog.e(TAG, "getSignal mContext is null!!!"); - } - - public boolean setDataEnabled(boolean enable) { - boolean result = false; - if (this.mContext != null) { - try { - int subid = SubscriptionManager.from(this.mContext).getActiveSubscriptionInfoForSimSlotIndex(0).getSubscriptionId(); - TelephonyManager telephonyService = (TelephonyManager) this.mContext.getSystemService("phone"); - Method setDataEnabled = telephonyService.getClass().getDeclaredMethod("setDataEnabled", Integer.TYPE, Boolean.TYPE); - if (null != setDataEnabled) { - setDataEnabled.invoke(telephonyService, Integer.valueOf(subid), Boolean.valueOf(enable)); - result = true; - } - } catch (Exception e) { - e.printStackTrace(); - DSLog.e(TAG, "setDataEnabled exception " + e.getMessage()); - } - } else { - DSLog.e(TAG, "setDataEnabled mContext is null!!!"); - } - return result; - } - - public boolean getDataEnabled() { - SubscriptionInfo subscriptionInfo = null; - if (this.mContext != null) { - boolean enabled = false; - try { - subscriptionInfo = SubscriptionManager.from(this.mContext).getActiveSubscriptionInfoForSimSlotIndex(0); - } catch (Exception e) { - e.printStackTrace(); - DSLog.e(TAG, "getDataEnabled Exception msg=" + e.getMessage()); - } - if (subscriptionInfo == null) { - return false; - } - int subid = subscriptionInfo.getSubscriptionId(); - TelephonyManager telephonyService = (TelephonyManager) this.mContext.getSystemService("phone"); - try - { - Method getDataEnabled = telephonyService.getClass().getDeclaredMethod("getDataEnabled", Integer.TYPE); - if (null != getDataEnabled) { - enabled = ((Boolean) getDataEnabled.invoke(telephonyService, Integer.valueOf(subid))).booleanValue(); - } - } - catch (NoSuchMethodException ex) - { - } - catch (IllegalAccessException ex) - { - - } - catch (InvocationTargetException ex) - { - - } - - return enabled; - } - DSLog.e(TAG, "getDataEnabled mContext is null!!!"); - return false; - } - - public String getIMEI() { - String imei = ""; - if (this.mContext != null) { - TelephonyManager manager = (TelephonyManager) this.mContext.getSystemService("phone"); - try { - Method method = manager.getClass().getMethod("getImei", Integer.TYPE); - String imei1 = (String) method.invoke(manager, 0); - imei = imei1; - } catch (Exception e) { - e.printStackTrace(); - DSLog.e(TAG, "getIMEI Exception msg=" + e.getMessage()); - } - } else { - DSLog.e(TAG, "getIMEI mContext is null!!!"); - } - return imei; - } - - public String getICCID() { - String iccId = ""; - if (this.mContext != null) { - SubscriptionManager sm = SubscriptionManager.from(this.mContext); - List sis = sm.getActiveSubscriptionInfoList(); - if (sis != null && sis.size() > 0) { - SubscriptionInfo si = (SubscriptionInfo)sis.get(0); - iccId = si.getIccId(); - } - } else { - DSLog.e(TAG, "getICCID mContext is null!!!"); - } - return iccId; - } - - public String get4GIPAddress() { - String ipStr = ""; - if (this.mContext != null) { - if (((ConnectivityManager) this.mContext.getSystemService("connectivity")).getActiveNetworkInfo() == null) { - return ipStr; - } - try { - Enumeration en = NetworkInterface.getNetworkInterfaces(); - while (en.hasMoreElements()) { - NetworkInterface intf = (NetworkInterface)en.nextElement(); - Enumeration enumIpAddr = intf.getInetAddresses(); - while (true) { - if (enumIpAddr.hasMoreElements()) { - InetAddress inetAddress = (InetAddress)enumIpAddr.nextElement(); - if (!inetAddress.isLoopbackAddress() && !inetAddress.isLinkLocalAddress() && intf.getName().contains("ccmni") && inetAddress.getHostAddress().toString().contains(".")) { - ipStr = inetAddress.getHostAddress().toString(); - break; - } - } - } - } - } catch (SocketException ex) { - DSLog.e(TAG, "get4GIPAddress SocketException:" + ex.toString()); - } - } else { - DSLog.e(TAG, "get4GIPAddress mContext is null!!!"); - } - return ipStr; - } - - public static String getCellularType(TelephonyManager mTelephonyManager) { - String cellularType; - int nSubType = mTelephonyManager.getNetworkType(); - if (nSubType == 1 || nSubType == 2 || nSubType == 7 || nSubType == 4 || nSubType == 16 || nSubType == 11) { - cellularType = "2G"; - } else if (nSubType == 3 || nSubType == 17 || nSubType == 12 || nSubType == 8 || nSubType == 9 || nSubType == 10 || nSubType == 5 || nSubType == 6 || nSubType == 15) { - cellularType = "3G"; - } else if (nSubType == 13 || nSubType == 18) { - cellularType = "4G"; - } else if (nSubType == 0) { - cellularType = "0G"; - } else { - cellularType = String.valueOf(nSubType); - } - return cellularType; - } - - public String getNetWorkType() { - String cellulartype = ""; - if (this.mContext != null) { - TelephonyManager mTelephonyManager = (TelephonyManager) this.mContext.getSystemService("phone"); - cellulartype = getCellularType(mTelephonyManager); - if (cellulartype.equals("0G")) { - cellulartype = ""; - } - } else { - DSLog.e(TAG, "getNetWorkType mContext is null!!!"); - } - return cellulartype; - } - - public String getSimOperatorName() { - String simOperator = ""; - if (this.mContext != null) { - TelephonyManager tm = (TelephonyManager) this.mContext.getSystemService("phone"); - simOperator = tm.getSimOperatorName(); - } else { - DSLog.e(TAG, "getSimOperatorName mContext is null!!!"); - } - return simOperator; - } - - private void delApn(String apn) { - if (this.mContext != null) { - int rows = this.mContext.getContentResolver().delete(APN_URI, "apn='" + apn + "'", null); - DSLog.d(TAG, "delApn apn=" + apn + ",rowse=" + rows); - return; - } - DSLog.e(TAG, "delApn mContext is null!!!"); - } - - private int getAPNId(String apn) { - int id = -1; - if (this.mContext != null) { - Cursor cr = this.mContext.getContentResolver().query(APN_URI, null, null, null, null); - while (true) { - if (cr == null || !cr.moveToNext()) { - break; - } else if (cr.getString(cr.getColumnIndex("apn")).equals(apn)) { - int idIndex = cr.getColumnIndex("_id"); - id = cr.getShort(idIndex); - break; - } - } - cr.close(); - } else { - DSLog.e(TAG, "getAPNId mContext is null!!!"); - } - return id; - } - - private void setAPN(int id) { - if (this.mContext != null) { - ContentResolver resolver = this.mContext.getContentResolver(); - ContentValues values = new ContentValues(); - values.put("apn_id", Integer.valueOf(id)); - resolver.update(CURRENT_APN_URI, values, null, null); - return; - } - DSLog.e(TAG, "setAPN mContext is null!!!"); - } - - private String getSIMInfo() { - if (this.mContext != null) { - TelephonyManager iPhoneManager = (TelephonyManager) this.mContext.getSystemService("phone"); - return iPhoneManager.getSimOperator(); - } - DSLog.e(TAG, "getSIMInfo mContext is null!!!"); - return ""; - } - - private int addAPN(String apnName, String apn, String user, String password, String mcc, String mnc, Integer authtype) { - int id = -1; - if (this.mContext != null) { - String NUMERIC = getSIMInfo(); - if (NUMERIC == null) { - return -1; - } - ContentResolver resolver = this.mContext.getContentResolver(); - ContentValues values = new ContentValues(); - values.put("name", apnName); - values.put("apn", apn); - values.put("type", "default"); - values.put("numeric", NUMERIC); - values.put("mcc", mcc); - values.put("mnc", mnc); - values.put("proxy", ""); - values.put("port", ""); - values.put("mmsproxy", ""); - values.put("mmsport", ""); - values.put("user", user); - values.put("server", ""); - values.put("password", password); - values.put("mmsc", ""); - values.put("authtype", authtype); - Cursor c = null; - Uri newRow = resolver.insert(APN_URI, values); - if (newRow != null) { - c = resolver.query(newRow, null, null, null, null); - int idIndex = c.getColumnIndex("_id"); - c.moveToFirst(); - id = c.getShort(idIndex); - } - if (c != null) { - c.close(); - } - } else { - DSLog.e(TAG, "addAPN mContext is null!!!"); - } - return id; - } - - public DS4GAPNInfo getAPNInfo() { - DS4GAPNInfo apnInfo = new DS4GAPNInfo(); - if (this.mContext != null) { - ContentResolver cResolver = this.mContext.getContentResolver(); - Cursor cr = cResolver.query(CURRENT_APN_URI, null, null, null, null); - if (cr != null && cr.getCount() > 0) { - cr.moveToFirst(); - apnInfo.setApn(cr.getString(cr.getColumnIndex("apn"))); - apnInfo.setPassword(cr.getString(cr.getColumnIndex("password"))); - apnInfo.setUser(cr.getString(cr.getColumnIndex("user"))); - apnInfo.setMcc(cr.getString(cr.getColumnIndex("mcc"))); - apnInfo.setMnc(cr.getString(cr.getColumnIndex("mnc"))); - apnInfo.setAuthtype(cr.getInt(cr.getColumnIndex("authtype"))); - cr.close(); - } - } else { - DSLog.e(TAG, "getAPNInfo mContext is null!!!"); - } - return apnInfo; - } - - public void setAPNInfo(DS4GAPNInfo apnInfo) { - delApn(apnInfo.getApn()); - int apnId = getAPNId(apnInfo.getApn()); - if (apnId < 0) { - apnId = addAPN(apnInfo.getApn(), apnInfo.getApn(), apnInfo.getUser(), apnInfo.getPassword(), apnInfo.getMcc(), apnInfo.getMnc(), Integer.valueOf(apnInfo.getAuthtype())); - } - setAPN(apnId); - } - - private void update4GSignal() { - getSignal(this.mSignalListener); - this.mHandler.postDelayed(new Runnable() { // from class: com.dowse.base.manager.DS4GManager.2 - @Override // java.lang.Runnable - public void run() { - DS4GManager.this.cleanSignalListener(DS4GManager.this.mSignalListener); - } - }, 60000L); - } - - public DS4GInfo getDS4GInfo() { - update4GSignal(); - DS4GInfo ds4GInfo = new DS4GInfo(); - DS4GAPNInfo ds4GAPNInfo = getAPNInfo(); - ds4GInfo.setApn(ds4GAPNInfo.getApn()); - ds4GInfo.setAuthtype(ds4GAPNInfo.getAuthtype()); - ds4GInfo.setMcc(ds4GAPNInfo.getMcc()); - ds4GInfo.setPassword(ds4GAPNInfo.getPassword()); - ds4GInfo.setUser(ds4GAPNInfo.getUser()); - ds4GInfo.setMnc(ds4GAPNInfo.getMnc()); - ds4GInfo.setIccid(getICCID()); - ds4GInfo.setImei(getIMEI()); - ds4GInfo.setIp(get4GIPAddress()); - ds4GInfo.setNetEnable(getDataEnabled() ? 1 : 0); - ds4GInfo.setOperateName(getSimOperatorName()); - ds4GInfo.setNetType(getNetWorkType()); - ds4GInfo.setLevel(0); - ds4GInfo.setdBm(0); - SignalStrength strength = getLatestSignalStrength(); - if (strength != null) { - int asu = strength.getGsmSignalStrength(); - int lastSignal = (-113) + (2 * asu); - ds4GInfo.setLevel(strength.getLevel()); - ds4GInfo.setdBm(lastSignal); - } - return ds4GInfo; - } -} diff --git a/app/src/main/java/com/dowse/base/manager/DSDeviceManager.java b/app/src/main/java/com/dowse/base/manager/DSDeviceManager.java deleted file mode 100644 index 71512c8e..00000000 --- a/app/src/main/java/com/dowse/base/manager/DSDeviceManager.java +++ /dev/null @@ -1,621 +0,0 @@ -package com.dowse.base.manager; - -import android.content.Context; -import android.content.Intent; -import android.os.SystemClock; -import android.text.TextUtils; -import com.dowse.base.DSParamManager; -import com.dowse.base.IParamListener; -import com.dowse.base.data.DSDeviceCustomInfo; -import com.dowse.base.data.DSDeviceInfo; -import com.dowse.base.data.StaticIPInfo; -import com.dowse.base.log.DSLog; -import com.dowse.base.param.NetType; -import com.dowse.base.param.ParamType; -import com.dowse.base.param.device.DeviceConfigUtil; -import com.dowse.base.param.maintenance.MaintenanceParam; -import com.dowse.base.param.pic.ChannelPicConfig; -import com.dowse.base.param.pic.ChannelPicParam; -import com.dowse.base.param.pic.DSPicParam; -import com.dowse.base.param.video.ChannelConfig; -import com.dowse.base.param.video.ChannelOSD; -import com.dowse.base.param.video.ChannelOSDConfig; -import com.dowse.base.param.video.ChannelVideoConfig; -import com.dowse.base.param.video.ChannelVideoParam; -import com.dowse.base.param.video.DSOSDParam; -import com.dowse.base.param.video.DSVideoParam; -import com.dowse.base.util.APKUtil; -import com.dowse.base.util.ContextUtil; -import com.dowse.base.util.DeviceUtil; -import com.dowse.base.util.OtaUpdateUtil; -import com.google.gson.Gson; -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSDeviceManager.class */ -public class DSDeviceManager implements IParamListener { - private static final String TAG = "DSDeviceManager"; - private static final String CAMERA_SERVER_PACKAGE_NAME = "com.dowse.app.camera.server"; - private static final String I1_PACKAGE_NAME = "com.dowse.i1app"; - private static final String I1_MASTER_PACKAGE_NAME = "com.dowse.i1master"; - private Context mContext; - private boolean paramServiceInit; - private List listeners; - - public static DSDeviceManager getInstance() { - return DSDeviceManagerHolder.instance; - } - - @Override // com.dowse.base.IParamListener - public void onInitResult(boolean result) { - DSLog.d(TAG, "DSParamManager onInitResult result=" + result); - this.paramServiceInit = result; - notifyConnectChange(result); - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSDeviceManager$DSDeviceManagerHolder.class */ - private static class DSDeviceManagerHolder { - public static final DSDeviceManager instance = new DSDeviceManager(); - - private DSDeviceManagerHolder() { - } - } - - private DSDeviceManager() { - this.mContext = null; - this.paramServiceInit = false; - this.listeners = null; - this.mContext = ContextUtil.getApplication(); - this.listeners = new ArrayList(); - DSParamManager.getInstance().setInitListener(this); - } - - public void setListener(IDeviceListener listener) { - if (listener != null) { - listener.onDeviceParamConnectChange(this.paramServiceInit); - this.listeners.add(listener); - } - } - - public void delListener(IDeviceListener listener) { - if ((this.listeners != null) & this.listeners.contains(listener)) { - this.listeners.remove(listener); - } - } - - private void notifyConnectChange(boolean result) { - for (IDeviceListener listener : this.listeners) { - listener.onDeviceParamConnectChange(result); - } - } - - public DSDeviceInfo getDeviceInfo() { - DSDeviceInfo deviceInfo = new DSDeviceInfo(); - deviceInfo.setModel(DeviceUtil.getModel()); - deviceInfo.setSerial_no(DeviceUtil.getSN()); - deviceInfo.setVersion(DeviceUtil.getSysVer()); - deviceInfo.setHard_ver(DeviceUtil.getHardVer()); - if (this.mContext != null) { - deviceInfo.setCamera_v_code(APKUtil.getVersionCode(this.mContext, CAMERA_SERVER_PACKAGE_NAME)); - deviceInfo.setCamera_v_name(APKUtil.getVersionName(this.mContext, CAMERA_SERVER_PACKAGE_NAME)); - deviceInfo.setI1_v_code(APKUtil.getVersionCode(this.mContext, I1_PACKAGE_NAME)); - deviceInfo.setI1_v_name(APKUtil.getVersionName(this.mContext, I1_PACKAGE_NAME)); - deviceInfo.setI1_master_v_code(APKUtil.getVersionCode(this.mContext, I1_MASTER_PACKAGE_NAME)); - deviceInfo.setI1_master_v_name(APKUtil.getVersionName(this.mContext, I1_MASTER_PACKAGE_NAME)); - } else { - DSLog.e(TAG, "getDeviceInfo mContext is null!!!"); - } - deviceInfo.setSystemTime(System.currentTimeMillis()); - return deviceInfo; - } - - public boolean setSystemTime(long time) { - return SystemClock.setCurrentTimeMillis(time); - } - - public StaticIPInfo getStaticIPInfo() { - StaticIPInfo staticIP = new StaticIPInfo(); - if (this.mContext != null) { - /* - String ethName = NetUtil.getStaticEthName(this.mContext); - if (!TextUtils.isEmpty(ethName)) { - staticIP = NetUtil.getStaticIP(this.mContext, ethName); - } else { - DSLog.e(TAG, "getStaticIPInfo ethName:" + ethName); - } - */ - } else { - DSLog.e(TAG, "getStaticIPInfo mContext is null!!!"); - } - return staticIP; - } - - public boolean setStaticIPInfo(StaticIPInfo staticIPInfo) { - boolean result = false; - DSLog.d(TAG, "setStaticIP StaticIPInfo msg=" + staticIPInfo.toString()); - - if (staticIPInfo != null) { - /* - String ethName = NetUtil.getStaticEthName(this.mContext); - if (!TextUtils.isEmpty(ethName)) { - result = NetUtil.setStaticIP(this.mContext, ethName, staticIPInfo); - } else { - DSLog.e(TAG, "getStaticIPInfo ethName:" + ethName); - } - - */ - } - return result; - } - - public MaintenanceParam getMaintenanceParam() { - MaintenanceParam param = MaintenanceParam.getDefault(this.mContext); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.MAINTENANCE.getKey(), TAG); - if (!TextUtils.isEmpty(paramStr)) { - try { - param = (MaintenanceParam) new Gson().fromJson(paramStr, MaintenanceParam.class); - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "getMaintenanceParam msg=" + e.getMessage()); - } - } else { - DSParamManager.getInstance().setParam(ParamType.MAINTENANCE.getKey(), new Gson().toJson(param), TAG); - } - } else { - DSLog.d(TAG, "getMaintenanceParam failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - DSLog.d(TAG, "param=" + param.toString()); - return param; - } - - public boolean setMaintenanceParam(int enable, String ip, int port, int sim) { - boolean result = false; - MaintenanceParam param = MaintenanceParam.getDefault(this.mContext); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.MAINTENANCE.getKey(), TAG); - try { - if (!TextUtils.isEmpty(paramStr)) { - param = (MaintenanceParam) new Gson().fromJson(paramStr, MaintenanceParam.class); - } - if (param != null) { - param.setEnable(enable); - param.setIp(ip); - param.setPort(port); - NetType curNetType = NetType.getNetType(sim); - String bindName = NetType.getBindEthName(this.mContext, sim); - if (curNetType != null && !TextUtils.isEmpty(bindName)) { - param.setNet(curNetType); - param.setNet_name(bindName); - result = DSParamManager.getInstance().setParam(ParamType.MAINTENANCE.getKey(), new Gson().toJson(param), TAG); - } else { - DSLog.e(TAG, "sim=" + sim + ",can't find netType,netType is null!!!use before = " + param.getNet()); - return false; - } - } else { - DSLog.d(TAG, "setMaintenanceParam failed,param is null!!!"); - } - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "setMaintenanceParam msg=" + e.getMessage()); - } - } else { - DSLog.d(TAG, "setMaintenanceParam failed,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - DSLog.d(TAG, "set param=" + param.toString()); - return result; - } - - public ChannelConfig getChannelConfig() { - ChannelConfig param = DeviceConfigUtil.getDefaultChannelConfig(); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.CHANNEL_CONFIG.getKey(), TAG); - if (!TextUtils.isEmpty(paramStr)) { - try { - param = (ChannelConfig) new Gson().fromJson(paramStr, ChannelConfig.class); - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "getChannelConfig msg=" + e.getMessage()); - } - } else { - DSParamManager.getInstance().setParam(ParamType.CHANNEL_CONFIG.getKey(), new Gson().toJson(param), TAG); - } - } else { - DSLog.d(TAG, "getChannelConfig failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - DSLog.d(TAG, "ChannelConfig = " + param.toString()); - return param; - } - - public ChannelOSDConfig getChannelOSDConfig() { - ChannelOSDConfig param = DeviceConfigUtil.getDefaultChannelOSDConfig(); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.CHANNEL_OSD_CONFIG.getKey(), TAG); - if (!TextUtils.isEmpty(paramStr)) { - try { - param = (ChannelOSDConfig) new Gson().fromJson(paramStr, ChannelOSDConfig.class); - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "getChannelOSDConfig msg=" + e.getMessage()); - } - } else { - DSParamManager.getInstance().setParam(ParamType.CHANNEL_OSD_CONFIG.getKey(), new Gson().toJson(param), TAG); - } - } else { - DSLog.d(TAG, "getChannelOSDConfig failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - DSLog.d(TAG, "getChannelOSDConfig param=" + param.toString()); - return param; - } - - public ChannelOSD getChannelOSD(int channel) { - ChannelOSDConfig config = getChannelOSDConfig(); - ChannelOSD channelOSD = DeviceConfigUtil.getChannelOSD(); - if (config != null && config.getOsdList() != null) { - for (DSOSDParam dsosdParam : config.getOsdList()) { - if (dsosdParam.getChannel() == channel) { - channelOSD = dsosdParam.getChannelOSD(); - } - } - } - return channelOSD; - } - - public boolean setChannelOSD(int channel, ChannelOSD channelOSD) { - List datas; - boolean result = false; - int index = -1; - ChannelOSDConfig config = getChannelOSDConfig(); - if (config != null && (datas = config.getOsdList()) != null) { - int total = datas.size(); - int i = 0; - while (true) { - if (i < total) { - DSOSDParam param = datas.get(i); - if (param == null || param.getChannel() != channel) { - i++; - } else { - index = i; - break; - } - } else { - break; - } - } - } - DSOSDParam osd = new DSOSDParam(); - osd.setChannelOSD(channelOSD); - osd.setChannel(channel); - if (index >= 0) { - config.getOsdList().remove(index); - config.getOsdList().add(osd); - } else { - if (config.getOsdList() == null) { - config.setOsdList(new ArrayList()); - } - config.getOsdList().add(osd); - } - if (this.paramServiceInit && this.mContext != null) { - result = DSParamManager.getInstance().setParam(ParamType.CHANNEL_OSD_CONFIG.getKey(), new Gson().toJson(config), TAG); - } else { - DSLog.d(TAG, "setChannelOSD failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - DSLog.d(TAG, "set param osd=" + osd.toString()); - return result; - } - - public ChannelPicConfig getChannelPicConfig() { - ChannelPicConfig param = DeviceConfigUtil.getDefaultChannelPicConfig(); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.CHANNEL_PIC_CONFIG.getKey(), TAG); - if (!TextUtils.isEmpty(paramStr)) { - try { - param = (ChannelPicConfig) new Gson().fromJson(paramStr, ChannelPicConfig.class); - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "getChannelPicConfig msg=" + e.getMessage()); - } - } else { - DSParamManager.getInstance().setParam(ParamType.CHANNEL_PIC_CONFIG.getKey(), new Gson().toJson(param), TAG); - } - } else { - DSLog.d(TAG, "getChannelPicConfig failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return param; - } - - public ChannelPicParam getChannelPicParam(int channel) { - ChannelPicConfig config = getChannelPicConfig(); - ChannelPicParam channelPicParam = DeviceConfigUtil.getChannelPicParam(); - if (config != null && config.getPicParams() != null) { - for (DSPicParam picParam : config.getPicParams()) { - if (picParam.getChannel() == channel) { - channelPicParam = picParam.getChannelPicParam(); - } - } - } - return channelPicParam; - } - - public boolean setChannelPicParam(int channel, ChannelPicParam channelPicParam) { - List datas; - boolean result = false; - int index = -1; - ChannelPicConfig config = getChannelPicConfig(); - if (config != null && (datas = config.getPicParams()) != null) { - int total = datas.size(); - int i = 0; - while (true) { - if (i < total) { - DSPicParam param = datas.get(i); - if (param == null || param.getChannel() != channel) { - i++; - } else { - index = i; - break; - } - } else { - break; - } - } - } - DSPicParam pic = new DSPicParam(); - pic.setChannel(channel); - pic.setChannelPicParam(channelPicParam); - if (index >= 0) { - config.getPicParams().remove(index); - config.getPicParams().add(pic); - } else { - if (config.getPicParams() == null) { - config.setPicParams(new ArrayList()); - } - config.getPicParams().add(pic); - } - if (this.paramServiceInit && this.mContext != null) { - result = DSParamManager.getInstance().setParam(ParamType.CHANNEL_PIC_CONFIG.getKey(), new Gson().toJson(config), TAG); - } else { - DSLog.d(TAG, "setChannelPicParam failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public String getI1Param(String key) { - String result = ""; - if (this.paramServiceInit && this.mContext != null) { - result = DSParamManager.getInstance().getParam(key, TAG); - DSLog.e(TAG, "key=" + key + ",json=" + result); - } else { - DSLog.d(TAG, "getI1Param failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public boolean setI1Param(String key, String i1Str) { - boolean result = false; - if (this.paramServiceInit && this.mContext != null) { - result = DSParamManager.getInstance().setParam(key, i1Str, TAG); - } else { - DSLog.d(TAG, "setI1Param failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public boolean systemReboot() { - boolean result = false; - if (this.mContext != null) { - Intent reboot = new Intent("android.intent.action.REBOOT"); - reboot.putExtra("nowait", 1); - reboot.putExtra("interval", 1); - reboot.putExtra("window", 0); - this.mContext.sendBroadcast(reboot); - result = true; - } else { - DSLog.d(TAG, "systemReboot failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public boolean installAPK(String filePath) { - boolean result = false; - if (this.mContext != null) { - if (!TextUtils.isEmpty(filePath) && new File(filePath).exists()) { - APKUtil.installAPK(this.mContext, filePath); - result = true; - } else { - DSLog.d(TAG, "installAPK failed filePath=" + filePath + ",or not exists"); - } - } else { - DSLog.d(TAG, "systemReboot failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public boolean startAPK(String packageName) { - boolean result = false; - if (this.mContext != null) { - APKUtil.startAPK(this.mContext, packageName); - result = true; - } else { - DSLog.d(TAG, "startAPK failed,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public boolean stopAPK(String packageName) { - boolean result = false; - if (this.mContext != null) { - APKUtil.stopAPK(this.mContext, packageName); - result = true; - } else { - DSLog.d(TAG, "startAPK failed,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public boolean restoryFactory() { - boolean result = false; - if (this.mContext != null) { - Intent intent = new Intent("android.intent.action.MASTER_CLEAR"); - intent.addFlags(16777216); - this.mContext.sendBroadcast(intent); - result = true; - } else { - DSLog.d(TAG, "systemReboot failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - /* JADX WARN: Type inference failed for: r0v11, types: [com.dowse.base.manager.DSDeviceManager$1] */ - public boolean otaUpdate() { - boolean result = false; - if (this.mContext != null) { - if (!TextUtils.isEmpty("/data/update.zip") && new File("/data/update.zip").exists()) { - new Thread() { // from class: com.dowse.base.manager.DSDeviceManager.1 - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - OtaUpdateUtil otaUpdateUtil = new OtaUpdateUtil(); - otaUpdateUtil.systemUpdate(DSDeviceManager.this.mContext, new OtaUpdateUtil.ProgressListener() { // from class: com.dowse.base.manager.DSDeviceManager.1.1 - @Override // com.dowse.base.util.OtaUpdateUtil.ProgressListener - public void onProgress(int progress, String log) { - DSLog.d(DSDeviceManager.TAG, "progress:" + progress + ",log=" + log); - } - }); - } - }.start(); - result = true; - } else { - DSLog.d(TAG, "otaUpdate failed otaPath=/data/update.zip,or not exists"); - } - } else { - DSLog.d(TAG, "systemReboot failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } - - public DSDeviceCustomInfo getDeviceCustomInfo() { - DSDeviceCustomInfo param = DeviceConfigUtil.getDefaultDeviceCustomInfo(); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.DEVICE_CUSTOM_INFO.getKey(), TAG); - if (!TextUtils.isEmpty(paramStr)) { - try { - param = (DSDeviceCustomInfo) new Gson().fromJson(paramStr, DSDeviceCustomInfo.class); - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "getDeviceCustomInfo msg=" + e.getMessage()); - } - } else { - DSParamManager.getInstance().setParam(ParamType.DEVICE_CUSTOM_INFO.getKey(), new Gson().toJson(param), TAG); - } - } else { - DSLog.d(TAG, "getDeviceCustomInfo failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - DSLog.d(TAG, "param=" + param.toString()); - return param; - } - - public boolean setDeviceCustomInfo(DSDeviceCustomInfo info) { - boolean result = false; - DSDeviceCustomInfo param = DeviceConfigUtil.getDefaultDeviceCustomInfo(); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.DEVICE_CUSTOM_INFO.getKey(), TAG); - try { - if (!TextUtils.isEmpty(paramStr)) { - param = (DSDeviceCustomInfo) new Gson().fromJson(paramStr, DSDeviceCustomInfo.class); - } - if (param != null) { - param.setManufacturerDate(info.getManufacturerDate()); - param.setManufacturer(info.getManufacturer()); - param.setDeviceModel(info.getDeviceModel()); - param.setComponentId(info.getComponentId()); - param.setDeviceName(info.getDeviceName()); - result = DSParamManager.getInstance().setParam(ParamType.DEVICE_CUSTOM_INFO.getKey(), new Gson().toJson(param), TAG); - } else { - DSLog.d(TAG, "setDeviceCustomInfo failed,param is null!!!"); - } - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "setDeviceCustomInfo msg=" + e.getMessage()); - } - } else { - DSLog.d(TAG, "setDeviceCustomInfo failed,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - DSLog.d(TAG, "set param=" + param.toString()); - return result; - } - - public ChannelVideoConfig getChannelVideoConfig() { - ChannelVideoConfig param = DeviceConfigUtil.getDefaultChannelVideoConfig(); - if (this.paramServiceInit && this.mContext != null) { - String paramStr = DSParamManager.getInstance().getParam(ParamType.CHANNEL_VIDEO_CONFIG.getKey(), TAG); - if (!TextUtils.isEmpty(paramStr)) { - try { - param = (ChannelVideoConfig) new Gson().fromJson(paramStr, ChannelVideoConfig.class); - } catch (Exception e) { - e.getMessage(); - DSLog.d(TAG, "getChannelVideoConfig msg=" + e.getMessage()); - } - } else { - DSParamManager.getInstance().setParam(ParamType.CHANNEL_VIDEO_CONFIG.getKey(), new Gson().toJson(param), TAG); - } - } else { - DSLog.d(TAG, "getChannelVideoConfig failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return param; - } - - public ChannelVideoParam getChannelVideoParam(int channel) { - ChannelVideoConfig config = getChannelVideoConfig(); - ChannelVideoParam channelVideoParam = DeviceConfigUtil.getChannelVideoParam(); - if (config != null && config.getVideoParams() != null) { - for (DSVideoParam videoParam : config.getVideoParams()) { - if (videoParam.getChannel() == channel) { - channelVideoParam = videoParam.getChannelVideoParam(); - } - } - } - return channelVideoParam; - } - - public boolean setChannelVideoParam(int channel, ChannelVideoParam channelVideoParam) { - List datas; - boolean result = false; - int index = -1; - ChannelVideoConfig config = getChannelVideoConfig(); - if (config != null && (datas = config.getVideoParams()) != null) { - int total = datas.size(); - int i = 0; - while (true) { - if (i < total) { - DSVideoParam param = datas.get(i); - if (param == null || param.getChannel() != channel) { - i++; - } else { - index = i; - break; - } - } else { - break; - } - } - } - DSVideoParam videoParam = new DSVideoParam(); - videoParam.setChannel(channel); - videoParam.setChannelVideoParam(channelVideoParam); - if (index >= 0) { - config.getVideoParams().remove(index); - config.getVideoParams().add(videoParam); - } else { - if (config.getVideoParams() == null) { - config.setVideoParams(new ArrayList()); - } - config.getVideoParams().add(videoParam); - } - if (this.paramServiceInit && this.mContext != null) { - result = DSParamManager.getInstance().setParam(ParamType.CHANNEL_VIDEO_CONFIG.getKey(), new Gson().toJson(config), TAG); - } else { - DSLog.d(TAG, "setChannelVideoParam failed,reset default,paramServiceInit=" + this.paramServiceInit + ",mContext=" + this.mContext); - } - return result; - } -} diff --git a/app/src/main/java/com/dowse/base/manager/DSGPSManager.java b/app/src/main/java/com/dowse/base/manager/DSGPSManager.java deleted file mode 100644 index a230e19b..00000000 --- a/app/src/main/java/com/dowse/base/manager/DSGPSManager.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.dowse.base.manager; - -import android.annotation.SuppressLint; -import android.content.Context; -import android.location.Location; -import android.location.LocationListener; -import android.location.LocationManager; -import android.os.Bundle; -import android.provider.Settings; -import com.dowse.base.data.DSLocation; -import com.dowse.base.log.DSLog; -import com.dowse.base.util.ContextUtil; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSGPSManager.class */ -public class DSGPSManager { - private static final String TAG = "DSGPSManager"; - private Context mContext; - private Location mLastLocation = null; - private LocationListener mLocationListener = new LocationListener() { // from class: com.dowse.base.manager.DSGPSManager.1 - @Override // android.location.LocationListener - public void onLocationChanged(Location location) { - DSLog.d(DSGPSManager.TAG, "onLocationChanged..."); - DSGPSManager.this.updateLocation(location); - } - - @Override // android.location.LocationListener - public void onStatusChanged(String provider, int status, Bundle extras) { - DSLog.d(DSGPSManager.TAG, "onStatusChanged..."); - } - - @Override // android.location.LocationListener - public void onProviderEnabled(String provider) { - DSLog.d(DSGPSManager.TAG, "onProviderEnabled..."); - DSGPSManager.this.updateLocation(DSGPSManager.this.getLastLocation(provider)); - } - - @Override // android.location.LocationListener - public void onProviderDisabled(String provider) { - DSLog.d(DSGPSManager.TAG, "onProviderDisabled..."); - DSGPSManager.this.updateLocation(null); - } - }; - - /* JADX INFO: Access modifiers changed from: private */ - public synchronized void updateLocation(Location location) { - this.mLastLocation = location; - } - - private synchronized Location getLastLocation() { - return this.mLastLocation; - } - - public DSGPSManager() { - this.mContext = null; - this.mContext = ContextUtil.getApplication(); - getGPSLocation(this.mLocationListener); - updateLocation(getLastLocation("gps")); - } - - public static DSGPSManager getInstance() { - return DSGPSManagerHolder.instance; - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSGPSManager$DSGPSManagerHolder.class */ - private static class DSGPSManagerHolder { - public static final DSGPSManager instance = new DSGPSManager(); - - private DSGPSManagerHolder() { - } - } - - public boolean isOpenGPS() { - if (this.mContext != null) { - LocationManager locationManager = (LocationManager) this.mContext.getSystemService("location"); - return locationManager.isProviderEnabled("gps"); - } - DSLog.e(TAG, "isOpenGPS mContext is null!"); - return false; - } - - @SuppressLint({"MissingPermission"}) - public Location getLastLocation(String provider) { - if (this.mContext != null) { - LocationManager locationManager = (LocationManager) this.mContext.getSystemService("location"); - return locationManager.getLastKnownLocation(provider); - } - DSLog.e(TAG, "getLastLocation mContext is null!"); - return null; - } - - @SuppressLint({"MissingPermission"}) - public void getGPSLocation(LocationListener listener) { - if (this.mContext != null) { - LocationManager locationManager = (LocationManager) this.mContext.getSystemService("location"); - locationManager.requestLocationUpdates("gps", 2000L, 8.0f, listener); - return; - } - DSLog.e(TAG, "getGPSLocation mContext is null!"); - } - - public boolean setGPS(boolean isOpen) { - if (this.mContext != null) { - Settings.Secure.setLocationProviderEnabled(this.mContext.getContentResolver(), "gps", isOpen); - return true; - } - DSLog.e(TAG, "setGPSStatus mContext is null!"); - return false; - } - - public DSLocation getDSLocation() { - return new DSLocation(isOpenGPS() ? 1 : 0, getLastLocation()); - } -} diff --git a/app/src/main/java/com/dowse/base/manager/DSRemoteManager.java b/app/src/main/java/com/dowse/base/manager/DSRemoteManager.java deleted file mode 100644 index c8adca92..00000000 --- a/app/src/main/java/com/dowse/base/manager/DSRemoteManager.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.dowse.base.manager; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.os.IBinder; -import android.os.RemoteException; -import com.dowse.base.IRemote; -import com.dowse.base.log.DSLog; -import com.dowse.base.util.ContextUtil; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSRemoteManager.class */ -public class DSRemoteManager { - private static final String TAG = "DSRemoteManager"; - private static final String REMOTE_SERVICE_ACTION = "com.dowse.base.service.remote"; - private static final String REMOTE_PACKAGE_NAME = "com.dowse.base.service"; - private Context mContext; - private IRemote mIRemote; - private boolean isBindSuccess; - private List listeners; - private ServiceConnection mRemoteServiceConnection; - - public static DSRemoteManager getInstance() { - return DSRemoteManagerHolder.instance; - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSRemoteManager$DSRemoteManagerHolder.class */ - private static class DSRemoteManagerHolder { - public static final DSRemoteManager instance = new DSRemoteManager(); - - private DSRemoteManagerHolder() { - } - } - - private DSRemoteManager() { - this.mContext = null; - this.mIRemote = null; - this.isBindSuccess = false; - this.mRemoteServiceConnection = new ServiceConnection() { // from class: com.dowse.base.manager.DSRemoteManager.1 - @Override // android.content.ServiceConnection - public void onServiceConnected(ComponentName componentName, IBinder iBinder) { - DSRemoteManager.this.mIRemote = IRemote.Stub.asInterface(iBinder); - DSRemoteManager.this.notifyConnectResult(true); - } - - @Override // android.content.ServiceConnection - public void onServiceDisconnected(ComponentName componentName) { - DSRemoteManager.this.mIRemote = null; - DSRemoteManager.this.isBindSuccess = false; - DSRemoteManager.this.notifyConnectResult(false); - } - }; - this.mContext = ContextUtil.getApplication(); - this.listeners = new ArrayList(); - initConnectRemote(); - } - - private void initConnectRemote() { - Intent intent = new Intent(); - intent.setAction(REMOTE_SERVICE_ACTION); - intent.setPackage(REMOTE_PACKAGE_NAME); - this.isBindSuccess = this.mContext.bindService(intent, this.mRemoteServiceConnection, 1); - DSLog.d(TAG, "bind service result = " + this.isBindSuccess); - } - - public void setConnectListener(IRemoteListener listener) { - if (listener != null) { - if (this.isBindSuccess && this.mIRemote != null) { - listener.onConnected(true); - } else { - this.listeners.add(listener); - } - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void notifyConnectResult(boolean result) { - for (IRemoteListener listener : this.listeners) { - listener.onConnected(result); - } - this.listeners.clear(); - } - - private void disconnectRemote() { - if (this.isBindSuccess) { - this.mContext.unbindService(this.mRemoteServiceConnection); - } - this.mIRemote = null; - this.isBindSuccess = false; - } - - public boolean callFun(int functionId, int channel, int media_type, String callTag) { - if (this.mIRemote == null) { - DSLog.e(TAG, "callFun Failed!!!,functionId=" + functionId + ",channel=" + channel + ",media_type=" + media_type + ",callTag=" + callTag); - if (!this.isBindSuccess) { - initConnectRemote(); - return false; - } - return false; - } - try { - return this.mIRemote.callFun(functionId, channel, media_type, callTag); - } catch (RemoteException e) { - e.printStackTrace(); - DSLog.e(TAG, "callFun Failed!!!,functionId=" + functionId + ",channel=" + channel + ",media_type=" + media_type + ",callTag=" + callTag + ",msg=" + e.getMessage()); - return false; - } - } - - public String callAIGetRegCode(String callTag) { - if (this.mIRemote == null) { - DSLog.e(TAG, "callFun Failed!!!,callTag=" + callTag); - if (!this.isBindSuccess) { - initConnectRemote(); - } - return ""; - } - try { - return this.mIRemote.callAIGetRegCode(callTag); - } catch (RemoteException e) { - e.printStackTrace(); - DSLog.e(TAG, "callFun Failed!!!,callTag=" + callTag + ",msg=" + e.getMessage()); - return ""; - } - } - - public boolean callAISetKey(String key, String callTag) { - if (this.mIRemote == null) { - DSLog.e(TAG, "callFun Failed!!!,key=" + key + "callTag=" + callTag); - if (!this.isBindSuccess) { - initConnectRemote(); - } - return false; - } - try { - return this.mIRemote.callAISetKey(key, callTag); - } catch (RemoteException e) { - e.printStackTrace(); - DSLog.e(TAG, "callFun Failed!!!,key=" + key + "callTag=" + callTag + ",msg=" + e.getMessage()); - return false; - } - } - - public String callFromRemote(String key, String param, String callTag) { - if (this.mIRemote == null) { - DSLog.e(TAG, "callFun Failed!!!,callTag=" + callTag); - if (!this.isBindSuccess) { - initConnectRemote(); - } - return ""; - } - try { - return this.mIRemote.callFromRemote(key, param, callTag); - } catch (RemoteException e) { - e.printStackTrace(); - DSLog.e(TAG, "callFun Failed!!!,callTag=" + callTag + ",msg=" + e.getMessage()); - return ""; - } - } -} diff --git a/app/src/main/java/com/dowse/base/manager/DSTFManager.java b/app/src/main/java/com/dowse/base/manager/DSTFManager.java deleted file mode 100644 index 1bed8696..00000000 --- a/app/src/main/java/com/dowse/base/manager/DSTFManager.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.dowse.base.manager; - -import android.content.Context; -import android.text.TextUtils; -import com.dowse.base.data.DSTFInfo; -import com.dowse.base.util.ContextUtil; -import com.dowse.base.util.TFUtil; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSTFManager.class */ -public class DSTFManager { - private static final String TAG = "DSTFManager"; - private Context mContext; - - public static DSTFManager getInstance() { - return DSTFManagerHolder.instance; - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSTFManager$DSTFManagerHolder.class */ - private static class DSTFManagerHolder { - public static final DSTFManager instance = new DSTFManager(); - - private DSTFManagerHolder() { - } - } - - private DSTFManager() { - this.mContext = null; - this.mContext = ContextUtil.getApplication(); - } - - public DSTFInfo getTFInfo() { - DSTFInfo dstfInfo = new DSTFInfo(); - if (this.mContext != null) { - String sdPath = TFUtil.getStoragePath(this.mContext, false); - String usbPath = TFUtil.getStoragePath(this.mContext, true); - if (!TextUtils.isEmpty(sdPath)) { - dstfInfo.setSdExsit(1); - dstfInfo.setSdTotal(TFUtil.getTotalSize(sdPath)); - dstfInfo.setSdLeft(TFUtil.getLeftSize(sdPath)); - } - if (!TextUtils.isEmpty(usbPath)) { - dstfInfo.setUsbExsit(1); - dstfInfo.setUsbTotal(TFUtil.getTotalSize(usbPath)); - dstfInfo.setUsbLeft(TFUtil.getLeftSize(usbPath)); - } - } - return dstfInfo; - } -} diff --git a/app/src/main/java/com/dowse/base/manager/DSWIFIManager.java b/app/src/main/java/com/dowse/base/manager/DSWIFIManager.java deleted file mode 100644 index 321ecfc0..00000000 --- a/app/src/main/java/com/dowse/base/manager/DSWIFIManager.java +++ /dev/null @@ -1,113 +0,0 @@ -package com.dowse.base.manager; - -import android.content.Context; -import android.net.wifi.WifiInfo; -import com.dowse.base.data.DSWIFIAPInfo; -import com.dowse.base.data.DSWIFIInfo; -import com.dowse.base.log.DSLog; -import com.dowse.base.util.ContextUtil; -import com.dowse.base.util.WifiUtil; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSWIFIManager.class */ -public class DSWIFIManager { - private static final String TAG = "DSWIFIManager"; - private Context mContext; - - public static DSWIFIManager getInstance() { - return DSWIFIManagerHolder.instance; - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/DSWIFIManager$DSWIFIManagerHolder.class */ - private static class DSWIFIManagerHolder { - public static final DSWIFIManager instance = new DSWIFIManager(); - - private DSWIFIManagerHolder() { - } - } - - private DSWIFIManager() { - this.mContext = null; - this.mContext = ContextUtil.getApplication(); - } - - public DSWIFIInfo getWifiInfo() { - DSWIFIInfo dswifiInfo = new DSWIFIInfo(); - dswifiInfo.setEnable(0); - dswifiInfo.setIp(""); - dswifiInfo.setSsid(""); - dswifiInfo.setPassword(""); - if (this.mContext != null) { - if (WifiUtil.isWifiOpen(this.mContext)) { - dswifiInfo.setEnable(1); - WifiInfo wifiInfo = WifiUtil.getWifInfo(this.mContext); - if (wifiInfo != null) { - dswifiInfo.setSsid(wifiInfo.getSSID()); - dswifiInfo.setIp(WifiUtil.intToIp(wifiInfo.getIpAddress())); - } - } - } else { - DSLog.e(TAG, "getWifiInfo mContext is null"); - } - return dswifiInfo; - } - - public boolean setWifiInfo(DSWIFIInfo dswifiInfo) { - boolean result; - DSLog.d(TAG, "setWifiInfo dswifiInfo=" + dswifiInfo.toString()); - if (this.mContext != null) { - if (dswifiInfo.getEnable() == 1) { - WifiUtil.connectWIFI(this.mContext, dswifiInfo.getSsid(), dswifiInfo.getPassword(), new WifiUtil.CallBack() { // from class: com.dowse.base.manager.DSWIFIManager.1 - @Override // com.dowse.base.util.WifiUtil.CallBack - public void connnectResult(boolean isSuccess) { - DSLog.d(DSWIFIManager.TAG, "onConnectWiFi isSuccess=" + isSuccess); - } - }); - result = true; - } else { - WifiUtil.disconnectWIFI(this.mContext); - result = true; - } - } else { - DSLog.e(TAG, "setWifiInfo mContext is null"); - result = false; - } - return result; - } - - public DSWIFIAPInfo getWiFiAPInfo() { - DSWIFIAPInfo dswifiapInfo = new DSWIFIAPInfo(); - dswifiapInfo.setEnable(0); - dswifiapInfo.setStatus(0); - dswifiapInfo.setSsid(""); - dswifiapInfo.setPassword(""); - if (this.mContext != null) { - if (WifiUtil.isWifiApEnabled(this.mContext)) { - dswifiapInfo.setEnable(1); - } - dswifiapInfo.setSsid(WifiUtil.getApSSID(this.mContext)); - dswifiapInfo.setStatus(WifiUtil.getWifiApState(this.mContext)); - } else { - DSLog.e(TAG, "getWiFiAPInfo mContext is null"); - } - return dswifiapInfo; - } - - public boolean setWiFiAPInfo(DSWIFIAPInfo info) { - boolean result; - DSLog.d(TAG, "setWiFiAPInfo DSWIFIAPInfo info=" + info.toString()); - if (info.getEnable() == 1) { - WifiUtil.disableAp(this.mContext); - try { - Thread.sleep(500L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - WifiUtil.enableAP(this.mContext, info.getSsid(), info.getPassword()); - result = true; - } else { - WifiUtil.disableAp(this.mContext); - result = true; - } - return result; - } -} diff --git a/app/src/main/java/com/dowse/base/manager/IDeviceListener.java b/app/src/main/java/com/dowse/base/manager/IDeviceListener.java deleted file mode 100644 index b6fbd26e..00000000 --- a/app/src/main/java/com/dowse/base/manager/IDeviceListener.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.dowse.base.manager; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/IDeviceListener.class */ -public interface IDeviceListener { - void onDeviceParamConnectChange(boolean z); -} diff --git a/app/src/main/java/com/dowse/base/manager/IRemoteListener.java b/app/src/main/java/com/dowse/base/manager/IRemoteListener.java deleted file mode 100644 index 4b5608f8..00000000 --- a/app/src/main/java/com/dowse/base/manager/IRemoteListener.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.dowse.base.manager; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/manager/IRemoteListener.class */ -public interface IRemoteListener { - void onConnected(boolean z); -} diff --git a/app/src/main/java/com/dowse/base/param/AACAudioParam.java b/app/src/main/java/com/dowse/base/param/AACAudioParam.java deleted file mode 100644 index d80d2bb4..00000000 --- a/app/src/main/java/com/dowse/base/param/AACAudioParam.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/AACAudioParam.class */ -public class AACAudioParam { - public static final int[] Sample_Frequencies = {96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350}; - private int profile = 2; - private int sample_frequency_index = 4; - private int sample_rate = Sample_Frequencies[this.sample_frequency_index]; - private int bit_rate = 96000; - private int channel_count = 2; - private int max_input_size = 1048576; - - public int getSample_rate() { - return this.sample_rate; - } - - public void setSample_rate(int sample_rate) { - this.sample_rate = sample_rate; - } - - public int getBit_rate() { - return this.bit_rate; - } - - public void setBit_rate(int bit_rate) { - this.bit_rate = bit_rate; - } - - public int getChannel_count() { - return this.channel_count; - } - - public void setChannel_count(int channel_count) { - this.channel_count = channel_count; - } - - public int getMax_input_size() { - return this.max_input_size; - } - - public void setMax_input_size(int max_input_size) { - this.max_input_size = max_input_size; - } - - public int getProfile() { - return this.profile; - } - - public void setProfile(int profile) { - this.profile = profile; - } - - public int getSample_frequency_index() { - return this.sample_frequency_index; - } - - public void setSample_frequency_index(int sample_frequency_index) { - this.sample_frequency_index = sample_frequency_index; - } - - public String toString() { - return "AACAudioParam{sample_rate=" + this.sample_rate + ", bit_rate=" + this.bit_rate + ", channel_count=" + this.channel_count + ", max_input_size=" + this.max_input_size + ", profile=" + this.profile + ", sample_frequency_index=" + this.sample_frequency_index + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/DeviceInfoParam.java b/app/src/main/java/com/dowse/base/param/DeviceInfoParam.java deleted file mode 100644 index b7573a61..00000000 --- a/app/src/main/java/com/dowse/base/param/DeviceInfoParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/DeviceInfoParam.class */ -public class DeviceInfoParam { - private String deviceid; - private String equipname; - private String model; - private float version; - private String manufacturer; - private long date; - private String identifier; - - public String getDeviceid() { - return this.deviceid; - } - - public void setDeviceid(String deviceid) { - this.deviceid = deviceid; - } - - public String getEquipname() { - return this.equipname; - } - - public void setEquipname(String equipname) { - this.equipname = equipname; - } - - public String getModel() { - return this.model; - } - - public void setModel(String model) { - this.model = model; - } - - public float getVersion() { - return this.version; - } - - public void setVersion(float version) { - this.version = version; - } - - public String getManufacturer() { - return this.manufacturer; - } - - public void setManufacturer(String manufacturer) { - this.manufacturer = manufacturer; - } - - public long getDate() { - return this.date; - } - - public void setDate(long date) { - this.date = date; - } - - public String getIdentifier() { - return this.identifier; - } - - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - public String toString() { - return "DeviceInfoParam{deviceid='" + this.deviceid + "', equipname='" + this.equipname + "', model='" + this.model + "', version=" + this.version + ", manufacturer='" + this.manufacturer + "', date=" + this.date + ", identifier='" + this.identifier + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/GB28181Param.java b/app/src/main/java/com/dowse/base/param/GB28181Param.java deleted file mode 100644 index 8ee0c62e..00000000 --- a/app/src/main/java/com/dowse/base/param/GB28181Param.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.dowse.base.param; - -import android.content.Context; -import com.dowse.base.log.DSLog; -import com.dowse.base.util.ContextUtil; -import com.dowse.base.util.StaticIP; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/GB28181Param.class */ -public class GB28181Param { - private static final String TAG = "GB28181Param"; - private NetType net_type; - private String net_name; - private String net_local_ip; - private int channel; - private int stream_no; - private String sip_server_ip; - private int sip_server_port; - private String sip_server_id; - private String sip_server_area; - private String user_id; - private String password; - private int heart_time; - private int reg_alive_time; - private int is_run; - private String dev_name; - private int camera_number = 1; - - public NetType getNet_type() { - return this.net_type; - } - - public String getNet_local_ip() { - return this.net_local_ip; - } - - public void setNet_local_ip(String net_local_ip) { - this.net_local_ip = net_local_ip; - } - - public void setNet_type(NetType net_type) { - this.net_type = net_type; - } - - public String getNet_name() { - return this.net_name; - } - - public void setNet_name(String net_name) { - this.net_name = net_name; - } - - public int getChannel() { - return this.channel; - } - - public void setChannel(int channel) { - this.channel = channel; - } - - public int getStream_no() { - return this.stream_no; - } - - public void setStream_no(int stream_no) { - this.stream_no = stream_no; - } - - public String getSip_server_ip() { - return this.sip_server_ip; - } - - public void setSip_server_ip(String sip_server_ip) { - this.sip_server_ip = sip_server_ip; - } - - public int getSip_server_port() { - return this.sip_server_port; - } - - public void setSip_server_port(int sip_server_port) { - this.sip_server_port = sip_server_port; - } - - public String getSip_server_id() { - return this.sip_server_id; - } - - public void setSip_server_id(String sip_server_id) { - this.sip_server_id = sip_server_id; - } - - public String getSip_server_area() { - return this.sip_server_area; - } - - public void setSip_server_area(String sip_server_area) { - this.sip_server_area = sip_server_area; - } - - public String getUser_id() { - return this.user_id; - } - - public void setUser_id(String user_id) { - this.user_id = user_id; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public int getHeart_time() { - return this.heart_time; - } - - public void setHeart_time(int heart_time) { - this.heart_time = heart_time; - } - - public int getIs_run() { - return this.is_run; - } - - public void setIs_run(int is_run) { - this.is_run = is_run; - } - - public int getReg_alive_time() { - return this.reg_alive_time; - } - - public void setReg_alive_time(int reg_alive_time) { - this.reg_alive_time = reg_alive_time; - } - - public String getDev_name() { - return this.dev_name; - } - - public void setDev_name(String dev_name) { - this.dev_name = dev_name; - } - - public int getCamera_number() { - return this.camera_number; - } - - public void setCamera_number(int camera_number) { - this.camera_number = camera_number; - } - - public void updateNetInfo() { - Context context = ContextUtil.getApplication(); - /* - if (this.net_type == NetType.SIM_1) { - this.net_name = NetUtil.getInner4GEthName(context); - this.net_local_ip = NetUtil.getInner4GIpAddress(context); - } else if (this.net_type == NetType.SIM_2) { - this.net_name = NetUtil.getOut4GEthName(context); - this.net_local_ip = NetUtil.getEthIpAddress(context, this.net_name); - } else if (this.net_type == NetType.WIFI) { - this.net_name = NetUtil.getWiFiName(); - this.net_local_ip = NetUtil.getWiFiIP(context); - } else if (this.net_type == NetType.VPN) { - this.net_name = NetUtil.getVPNEthName(context); - this.net_local_ip = NetUtil.getVPNIpAddress(context); - } else if (this.net_type == NetType.ETH) { - this.net_name = NetUtil.getStaticEthName(context); - StaticIP staticIP = DS_NetWork.getStaticIP(context, this.net_name); - this.net_local_ip = staticIP == null ? "" : staticIP.getIp(); - } else { - this.net_name = ""; - String ethName = NetUtil.getStaticEthName(context); - StaticIP staticIP2 = DS_NetWork.getStaticIP(context, ethName); - this.net_local_ip = staticIP2 == null ? "" : staticIP2.getIp(); - } - - */ - DSLog.d(TAG, "updateNetInfo " + toString()); - } - - public static GB28181Param getDefaultParam(int index) { - GB28181Param param = new GB28181Param(); - param.setUser_id("3402000000200001000" + index); - param.setPassword("hhit@2021"); - param.setSip_server_port(15060); - param.setSip_server_area("3402000000"); - param.setSip_server_id("34020000002000000001"); - param.setSip_server_ip("112.0.170.178"); - param.setStream_no(0); - param.setChannel(0); - if (index == 1) { - param.setNet_type(NetType.SIM_1); - } else { - param.setNet_type(NetType.SIM_2); - } - param.setNet_name(""); - param.setIs_run(1); - param.setHeart_time(30); - param.setReg_alive_time(300); - param.setDev_name("DowseBall"); - param.setNet_local_ip("192.168.18.129"); - return param; - } - - public String toString() { - return "GB28181Param{net_type=" + this.net_type + ", net_name='" + this.net_name + "', net_local_ip='" + this.net_local_ip + "', channel=" + this.channel + ", stream_no=" + this.stream_no + ", sip_server_ip='" + this.sip_server_ip + "', sip_server_port=" + this.sip_server_port + ", sip_server_id='" + this.sip_server_id + "', sip_server_area='" + this.sip_server_area + "', user_id='" + this.user_id + "', password='" + this.password + "', heart_time=" + this.heart_time + ", reg_alive_time=" + this.reg_alive_time + ", is_run=" + this.is_run + ", dev_name='" + this.dev_name + "', camera_number=" + this.camera_number + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/I1Param.java b/app/src/main/java/com/dowse/base/param/I1Param.java deleted file mode 100644 index 803cdefa..00000000 --- a/app/src/main/java/com/dowse/base/param/I1Param.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/I1Param.class */ -public class I1Param { - private String ip; - private int port; - - public String getIp() { - return this.ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public int getPort() { - return this.port; - } - - public void setPort(int port) { - this.port = port; - } - - public String toString() { - return "I1Param{ip='" + this.ip + "', port=" + this.port + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/NetType.java b/app/src/main/java/com/dowse/base/param/NetType.java deleted file mode 100644 index d9738f24..00000000 --- a/app/src/main/java/com/dowse/base/param/NetType.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.dowse.base.param; - -import android.content.Context; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/NetType.class */ -public enum NetType { - SIM_1(0, "Inner 4G"), - SIM_2(1, "Out 4G"), - WIFI(2, "WiFi"), - VPN(3, "VPN"), - ETH(4, "ETH"); - - private int net_type; - private String name; - - NetType(int net_type, String name) { - this.net_type = net_type; - this.name = name; - } - - public int getNet_type() { - return this.net_type; - } - - public void setNet_type(int net_type) { - this.net_type = net_type; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public static NetType getNetType(int sim) { - NetType netType = null; - if (sim == SIM_1.getNet_type()) { - netType = SIM_1; - } else if (sim == SIM_2.getNet_type()) { - netType = SIM_2; - } else if (sim == WIFI.getNet_type()) { - netType = WIFI; - } else if (sim == ETH.getNet_type()) { - netType = ETH; - } - return netType; - } - - public static int getSim(NetType netType) { - int sim = SIM_1.getNet_type(); - if (netType != null) { - sim = netType.getNet_type(); - } - return sim; - } - - public static String getBindEthName(Context context, int sim) { - String bindEth = "eth0"; - /* - if (sim == SIM_1.getNet_type()) { - bindEth = NetUtil.getInner4GEthName(context); - } else if (sim == SIM_2.getNet_type()) { - bindEth = NetUtil.getOut4GEthName(context); - } else if (sim == WIFI.getNet_type()) { - bindEth = NetUtil.getWiFiName(); - } else if (sim == ETH.getNet_type()) { - bindEth = NetUtil.getStaticEthName(context); - } - - */ - return bindEth; - } - - @Override // java.lang.Enum - public String toString() { - return "NetType{net_type=" + this.net_type + ", name='" + this.name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/PTZParam.java b/app/src/main/java/com/dowse/base/param/PTZParam.java deleted file mode 100644 index fc45eb01..00000000 --- a/app/src/main/java/com/dowse/base/param/PTZParam.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/PTZParam.class */ -public class PTZParam { - private int speed; - - public int getSpeed() { - return this.speed; - } - - public void setSpeed(int speed) { - this.speed = speed; - } - - public String toString() { - return "PTZParam{speed=" + this.speed + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/ParamType.java b/app/src/main/java/com/dowse/base/param/ParamType.java deleted file mode 100644 index 625fc94d..00000000 --- a/app/src/main/java/com/dowse/base/param/ParamType.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/ParamType.class */ -public enum ParamType { - DEVICE_TYPE(1, "device_type", "Device Type"), - CHANNEL_CONFIG(2, "channel_config", "Channel Config"), - RECORD_CONFIG(3, "record_config", "Record Config"), - CHANNEL_OSD_CONFIG(4, "channel_osd_config", "Channel OSD Config"), - CHANNEL_PIC_CONFIG(5, "channel_pic_config", "Channel PIC Config"), - CHANNEL_VIDEO_CONFIG(6, "channel_video_config", "Channel Video Config"), - DEVICE_WIFI_AP_CONFIG(7, "wifi_ap_config", "WIFI AP Config"), - RECORD_BASE_CONFIG(8, "record_base_config", "Record Base Config"), - GB28181_APP(100, "gb28181_1", "First GB28181 App"), - GB28181_APP_SECOND(101, "gb28181_2", "Second GB28181 App"), - TURN_ON_OFF_TIME(102, "turn_on_off_time", "I1 Turn On Off Time"), - DEVICE_INFO(103, "device_info", "Device Info"), - PTZ_INFO(104, "ptz_info", "PTZ Info"), - I1_PARAM(105, "i1_param", "I1 Param"), - RV1126_TAKE_PIC(106, "rv1126_take_pic", "RV1126 Take Pic Param"), - RV1126_PIC(107, "rv1126_pic", "RV1126 Pic Param"), - RV1126_VIDEO(108, "rv1126_video", "RV1126 Video Param"), - MAINTENANCE(200, "maintenance", "Maintenance Server Config Param"), - DEVICE_CUSTOM_INFO(201, "custom_dev_info", "Customer Device Info"), - I1_PARAM_MAINTENANCE_CONTROL(300, "i1_maintenance_control", "I1 Maintenance Control Param"), - I1_PARAM_BASE(301, "i1_base", "I1 Param Base"), - I1_PARAM_ALL(302, "i1_all", "I1 Param All"), - I1_PARAM_ZJ(303, "i1_zj", "I1 Param ZheJiang"), - I1_PARAM_JS(304, "i1_js", "I1 Param JiangShu"), - I1_PARAM_AH(305, "i1_ah", "I1 Param AnHui"); - - private int index; - private String key; - private String name; - - ParamType(int index, String key, String name) { - this.index = index; - this.key = key; - this.name = name; - } - - public int getIndex() { - return this.index; - } - - public void setIndex(int index) { - this.index = index; - } - - public String getKey() { - return this.key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - @Override // java.lang.Enum - public String toString() { - return "ParamType{index=" + this.index + ", key='" + this.key + "', name='" + this.name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/RV1126PicParam.java b/app/src/main/java/com/dowse/base/param/RV1126PicParam.java deleted file mode 100644 index ec11dc19..00000000 --- a/app/src/main/java/com/dowse/base/param/RV1126PicParam.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/RV1126PicParam.class */ -public class RV1126PicParam { - private int luminance; - private int contrast; - private int saturation; - - public int getLuminance() { - return this.luminance; - } - - public void setLuminance(int luminance) { - this.luminance = luminance; - } - - public int getContrast() { - return this.contrast; - } - - public void setContrast(int contrast) { - this.contrast = contrast; - } - - public int getSaturation() { - return this.saturation; - } - - public void setSaturation(int saturation) { - this.saturation = saturation; - } - - public String toString() { - return "RV1126PicParam{luminance=" + this.luminance + ", contrast=" + this.contrast + ", saturation=" + this.saturation + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/RV1126TakePicParam.java b/app/src/main/java/com/dowse/base/param/RV1126TakePicParam.java deleted file mode 100644 index 096f786c..00000000 --- a/app/src/main/java/com/dowse/base/param/RV1126TakePicParam.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/RV1126TakePicParam.class */ -public class RV1126TakePicParam { - private int picSizeType; - - public int getPicSizeType() { - return this.picSizeType; - } - - public void setPicSizeType(int picSizeType) { - this.picSizeType = picSizeType; - } - - public String toString() { - return "RV1126TakePicParam{picSizeType=" + this.picSizeType + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/RV1126VideoParam.java b/app/src/main/java/com/dowse/base/param/RV1126VideoParam.java deleted file mode 100644 index 232a986f..00000000 --- a/app/src/main/java/com/dowse/base/param/RV1126VideoParam.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/RV1126VideoParam.class */ -public class RV1126VideoParam { - private int videoBitRate; - private int videoFrameRate; - private int videoResolution; - - public int getVideoBitRate() { - return this.videoBitRate; - } - - public void setVideoBitRate(int videoBitRate) { - this.videoBitRate = videoBitRate; - } - - public int getVideoFrameRate() { - return this.videoFrameRate; - } - - public void setVideoFrameRate(int videoFrameRate) { - this.videoFrameRate = videoFrameRate; - } - - public int getVideoResolution() { - return this.videoResolution; - } - - public void setVideoResolution(int videoResolution) { - this.videoResolution = videoResolution; - } - - public String toString() { - return "RV1126VideoParam{videoBitRate=" + this.videoBitRate + ", videoFrameRate=" + this.videoFrameRate + ", videoResolution=" + this.videoResolution + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/TurnOnOffTimeParam.java b/app/src/main/java/com/dowse/base/param/TurnOnOffTimeParam.java deleted file mode 100644 index 18fb75e8..00000000 --- a/app/src/main/java/com/dowse/base/param/TurnOnOffTimeParam.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.dowse.base.param; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/TurnOnOffTimeParam.class */ -public class TurnOnOffTimeParam { - private String turnOn; - private String turnOff; - - public String getTurnOn() { - return this.turnOn; - } - - public void setTurnOn(String turnOn) { - this.turnOn = turnOn; - } - - public String getTurnOff() { - return this.turnOff; - } - - public void setTurnOff(String turnOff) { - this.turnOff = turnOff; - } - - public String toString() { - return "TurnOnOffTime{turnOn='" + this.turnOn + "', turnOff='" + this.turnOff + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/audio/AudioForamt.java b/app/src/main/java/com/dowse/base/param/audio/AudioForamt.java deleted file mode 100644 index fae12db1..00000000 --- a/app/src/main/java/com/dowse/base/param/audio/AudioForamt.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.dowse.base.param.audio; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/audio/AudioForamt.class */ -public enum AudioForamt { - A_PCM(0, "PCM"); - - private int type; - private String name; - - AudioForamt(int type, String name) { - this.type = type; - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public int getType() { - return this.type; - } - - public void setType(int type) { - this.type = type; - } - - @Override // java.lang.Enum - public String toString() { - return "VideoForamt{type=" + this.type + ", name='" + this.name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/device/DSwifiAPConfig.java b/app/src/main/java/com/dowse/base/param/device/DSwifiAPConfig.java deleted file mode 100644 index 3e60b698..00000000 --- a/app/src/main/java/com/dowse/base/param/device/DSwifiAPConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.dowse.base.param.device; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/device/DSwifiAPConfig.class */ -public class DSwifiAPConfig { - private static final String AP_PRE = "XY"; - private static final String PASSWORD = "12345678"; - private String ap_name_pre = AP_PRE; - private String password = PASSWORD; - - public String getAp_name_pre() { - return this.ap_name_pre; - } - - public void setAp_name_pre(String ap_name_pre) { - this.ap_name_pre = ap_name_pre; - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String toString() { - return "DSwifiAPConfig{ap_name_pre='" + this.ap_name_pre + "', password='" + this.password + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/device/DeviceConfigUtil.java b/app/src/main/java/com/dowse/base/param/device/DeviceConfigUtil.java deleted file mode 100644 index 2094ebec..00000000 --- a/app/src/main/java/com/dowse/base/param/device/DeviceConfigUtil.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.dowse.base.param.device; - -import com.dowse.base.data.DSDeviceCustomInfo; -import com.dowse.base.log.DSLog; -import com.dowse.base.param.pic.ChannelPicConfig; -import com.dowse.base.param.pic.ChannelPicParam; -import com.dowse.base.param.pic.DSPicParam; -import com.dowse.base.param.video.ChannelConfig; -import com.dowse.base.param.video.ChannelOSD; -import com.dowse.base.param.video.ChannelOSDConfig; -import com.dowse.base.param.video.ChannelType; -import com.dowse.base.param.video.ChannelVideoConfig; -import com.dowse.base.param.video.ChannelVideoParam; -import com.dowse.base.param.video.DSChannel; -import com.dowse.base.param.video.DSOSDParam; -import com.dowse.base.param.video.DSStream; -import com.dowse.base.param.video.DSVideoParam; -import com.dowse.base.param.video.StreamType; -import com.dowse.base.util.DeviceUtil; -import java.util.ArrayList; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/device/DeviceConfigUtil.class */ -public class DeviceConfigUtil { - private static final String TAG = "DeviceConfigUtil"; - - private static List getStreams(DeviceType deviceType) { - List streams = new ArrayList<>(); - DSStream mainStream = new DSStream(); - mainStream.setStreamType(StreamType.MAIN_STREAM); - DSStream subStream = new DSStream(); - subStream.setStreamType(StreamType.SUB_STREAM); - DSStream threeStream = new DSStream(); - threeStream.setStreamType(StreamType.THIRD_STREAM); - switch (AnonymousClass1.$SwitchMap$com$dowse$base$param$device$DeviceType[deviceType.ordinal()]) { - case 1: - case 2: - case DeviceConst.SYSTEM_REBOOT /* 3 */: - mainStream.setSupport(true); - subStream.setSupport(false); - threeStream.setSupport(false); - break; - } - streams.add(mainStream); - streams.add(subStream); - streams.add(threeStream); - return streams; - } - - /* JADX INFO: Access modifiers changed from: package-private */ - /* renamed from: com.dowse.base.param.device.DeviceConfigUtil$1 reason: invalid class name */ - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/device/DeviceConfigUtil$1.class */ - public static /* synthetic */ class AnonymousClass1 { - static final /* synthetic */ int[] $SwitchMap$com$dowse$base$param$device$DeviceType = new int[DeviceType.values().length]; - - static { - try { - $SwitchMap$com$dowse$base$param$device$DeviceType[DeviceType.DS_BALL_NORMAL.ordinal()] = 1; - } catch (NoSuchFieldError e) { - } - try { - $SwitchMap$com$dowse$base$param$device$DeviceType[DeviceType.DS_DUAL_IRON.ordinal()] = 2; - } catch (NoSuchFieldError e2) { - } - try { - $SwitchMap$com$dowse$base$param$device$DeviceType[DeviceType.DS_DUAL_PLASTICS.ordinal()] = 3; - } catch (NoSuchFieldError e3) { - } - } - } - - private static List getChannels(DeviceType deviceType) { - List channels = new ArrayList<>(); - switch (AnonymousClass1.$SwitchMap$com$dowse$base$param$device$DeviceType[deviceType.ordinal()]) { - case 2: - DSChannel channel_1 = new DSChannel(); - channel_1.setChannelType(ChannelType.MTK_CAMERA_FRONT_1); - channel_1.setChannel(1); - channel_1.setSdk_channel(1); - channel_1.setEnable(true); - channel_1.setStreams(getStreams(deviceType)); - channels.add(channel_1); - DSChannel channel_2 = new DSChannel(); - channel_2.setChannelType(ChannelType.MTK_CAMERA_BACK_1); - channel_2.setChannel(2); - channel_2.setSdk_channel(2); - channel_2.setEnable(true); - channel_2.setStreams(getStreams(deviceType)); - channels.add(channel_2); - break; - } - return channels; - } - - private static DeviceType getDeviceType() { - DeviceType deviceType = DeviceType.DS_DUAL_IRON; - String model = DeviceUtil.getModel(); - DSLog.d(TAG, "model:" + model); - return deviceType; - } - - public static ChannelConfig getDefaultChannelConfig() { - DeviceType deviceType = getDeviceType(); - ChannelConfig config = new ChannelConfig(); - config.setDeviceType(deviceType); - config.setChannels(getChannels(deviceType)); - return config; - } - - public static ChannelOSD getChannelOSD() { - ChannelOSD channelOSD = new ChannelOSD(); - channelOSD.setTimeEnable(true); - channelOSD.setInfoEnable(true); - channelOSD.setTextOSDS(null); - return channelOSD; - } - - public static ChannelOSDConfig getDefaultChannelOSDConfig() { - ChannelOSDConfig osdConfig = new ChannelOSDConfig(); - ChannelConfig channelConfig = getDefaultChannelConfig(); - List osds = new ArrayList<>(); - if (channelConfig != null && channelConfig.getChannels() != null) { - for (DSChannel channel : channelConfig.getChannels()) { - DSOSDParam dsosdParam = new DSOSDParam(); - dsosdParam.setChannel(channel.getChannel()); - dsosdParam.setChannelOSD(getChannelOSD()); - osds.add(dsosdParam); - } - } - osdConfig.setOsdList(osds); - return osdConfig; - } - - public static ChannelPicParam getChannelPicParam() { - ChannelPicParam channelPicParam = new ChannelPicParam(); - channelPicParam.setColor(1); - channelPicParam.setLuminance(80); - channelPicParam.setSaturation(80); - channelPicParam.setContrast(80); - channelPicParam.setWidth(1920); - channelPicParam.setHeight(1080); - channelPicParam.setCompress_radio(100); - return channelPicParam; - } - - public static ChannelVideoParam getChannelVideoParam() { - ChannelVideoParam channelVideoParam = new ChannelVideoParam(); - channelVideoParam.setBit_rate(8294400); - channelVideoParam.setFrame_rate(24); - channelVideoParam.setI_frame_interval(1); - return channelVideoParam; - } - - public static ChannelPicConfig getDefaultChannelPicConfig() { - ChannelConfig channelConfig = getDefaultChannelConfig(); - ChannelPicConfig picConfig = new ChannelPicConfig(); - List pics = new ArrayList<>(); - if (channelConfig != null && channelConfig.getChannels() != null) { - for (DSChannel channel : channelConfig.getChannels()) { - DSPicParam dsPicParam = new DSPicParam(); - dsPicParam.setChannel(channel.getChannel()); - dsPicParam.setChannelPicParam(getChannelPicParam()); - pics.add(dsPicParam); - } - } - picConfig.setPicParams(pics); - return picConfig; - } - - public static DSDeviceCustomInfo getDefaultDeviceCustomInfo() { - DSDeviceCustomInfo customInfo = new DSDeviceCustomInfo(); - customInfo.setDeviceModel(DeviceUtil.getModel()); - customInfo.setDeviceName(DeviceUtil.getModel()); - customInfo.setDeviceVersion(DeviceUtil.getSysVer()); - customInfo.setProductionNo(DeviceUtil.getSN()); - customInfo.setManufacturerDate(""); - customInfo.setComponentId(""); - customInfo.setManufacturer(""); - return customInfo; - } - - public static ChannelVideoConfig getDefaultChannelVideoConfig() { - ChannelConfig channelConfig = getDefaultChannelConfig(); - ChannelVideoConfig videoConfig = new ChannelVideoConfig(); - List videoParams = new ArrayList<>(); - if (channelConfig != null && channelConfig.getChannels() != null) { - for (DSChannel channel : channelConfig.getChannels()) { - DSVideoParam dsVideoParam = new DSVideoParam(); - dsVideoParam.setChannel(channel.getChannel()); - dsVideoParam.setChannelVideoParam(getChannelVideoParam()); - videoParams.add(dsVideoParam); - } - } - videoConfig.setVideoParams(videoParams); - return videoConfig; - } -} diff --git a/app/src/main/java/com/dowse/base/param/device/DeviceConst.java b/app/src/main/java/com/dowse/base/param/device/DeviceConst.java deleted file mode 100644 index 8a54a203..00000000 --- a/app/src/main/java/com/dowse/base/param/device/DeviceConst.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.dowse.base.param.device; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/device/DeviceConst.class */ -public interface DeviceConst { - public static final int APK_START = 1; - public static final int APK_STOP = 2; - public static final int APK_UPDATE = 1; - public static final int SYSTEM_UPDATE = 2; - public static final int SYSTEM_RESTOR_FACTORY = 99; - public static final int SYSTEM_REBOOT = 3; -} diff --git a/app/src/main/java/com/dowse/base/param/device/DeviceType.java b/app/src/main/java/com/dowse/base/param/device/DeviceType.java deleted file mode 100644 index 9f85ac9e..00000000 --- a/app/src/main/java/com/dowse/base/param/device/DeviceType.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.dowse.base.param.device; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/device/DeviceType.class */ -public enum DeviceType { - DS_BALL_NORMAL(0, "Ball Normal Version"), - DS_DUAL_IRON(10, "Dual camera with ironclad "), - DS_DUAL_PLASTICS(11, "Dual camera with plastics "); - - private int type; - private String name; - - DeviceType(int type, String name) { - this.type = type; - this.name = name; - } - - public int getType() { - return this.type; - } - - public void setType(int type) { - this.type = type; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - @Override // java.lang.Enum - public String toString() { - return "DeviceType{type=" + this.type + ", name='" + this.name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/i1/I1Const.java b/app/src/main/java/com/dowse/base/param/i1/I1Const.java deleted file mode 100644 index 65ea6874..00000000 --- a/app/src/main/java/com/dowse/base/param/i1/I1Const.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.dowse.base.param.i1; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/i1/I1Const.class */ -public class I1Const { -} diff --git a/app/src/main/java/com/dowse/base/param/i1/I1ParamAH.java b/app/src/main/java/com/dowse/base/param/i1/I1ParamAH.java deleted file mode 100644 index 4a546bff..00000000 --- a/app/src/main/java/com/dowse/base/param/i1/I1ParamAH.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.dowse.base.param.i1; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/i1/I1ParamAH.class */ -public class I1ParamAH { -} diff --git a/app/src/main/java/com/dowse/base/param/i1/I1ParamJS.java b/app/src/main/java/com/dowse/base/param/i1/I1ParamJS.java deleted file mode 100644 index 1babf4eb..00000000 --- a/app/src/main/java/com/dowse/base/param/i1/I1ParamJS.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.dowse.base.param.i1; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/i1/I1ParamJS.class */ -public class I1ParamJS { -} diff --git a/app/src/main/java/com/dowse/base/param/i1/I1ParamZJ.java b/app/src/main/java/com/dowse/base/param/i1/I1ParamZJ.java deleted file mode 100644 index 867e6ede..00000000 --- a/app/src/main/java/com/dowse/base/param/i1/I1ParamZJ.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.dowse.base.param.i1; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/i1/I1ParamZJ.class */ -public class I1ParamZJ { -} diff --git a/app/src/main/java/com/dowse/base/param/maintenance/MaintenanceParam.java b/app/src/main/java/com/dowse/base/param/maintenance/MaintenanceParam.java deleted file mode 100644 index 8f5e2277..00000000 --- a/app/src/main/java/com/dowse/base/param/maintenance/MaintenanceParam.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.dowse.base.param.maintenance; - -import android.content.Context; -import com.dowse.base.param.NetType; -import com.dowse.base.util.DeviceUtil; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/maintenance/MaintenanceParam.class */ -public class MaintenanceParam { - private static final String defaultIP = "180.166.218.222"; - private static final int defaultPort = 51168; - private static final String AUTH_NAME = "ds_android"; - private int enable; - private String ip; - private int port; - private NetType net; - private String net_name; - private String authName; - private String deviceID; - - public String getAuthName() { - return this.authName; - } - - public void setAuthName(String authName) { - this.authName = authName; - } - - public String getDeviceID() { - return this.deviceID; - } - - public void setDeviceID(String deviceID) { - this.deviceID = deviceID; - } - - public int getEnable() { - return this.enable; - } - - public void setEnable(int enable) { - this.enable = enable; - } - - public String getIp() { - return this.ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public int getPort() { - return this.port; - } - - public void setPort(int port) { - this.port = port; - } - - public NetType getNet() { - return this.net; - } - - public void setNet(NetType net) { - this.net = net; - } - - public String getNet_name() { - return this.net_name; - } - - public void setNet_name(String net_name) { - this.net_name = net_name; - } - - public int getSim() { - return this.net.getNet_type(); - } - - public static MaintenanceParam getDefault(Context context) { - MaintenanceParam param = new MaintenanceParam(); - param.setAuthName(AUTH_NAME); - param.setDeviceID(DeviceUtil.getSN()); - param.setEnable(1); - param.setNet(NetType.SIM_2); - // param.setNet_name(NetUtil.getOut4GEthName(context)); - param.setIp(defaultIP); - param.setPort(defaultPort); - param.setAuthName(AUTH_NAME); - param.setDeviceID(DeviceUtil.getSN()); - return param; - } - - public void setSim(int sim) { - NetType netType = NetType.getNetType(sim); - if (netType == null) { - netType = NetType.SIM_2; - } - this.net = netType; - } - - public String toString() { - return "MaintenanceParam{enable=" + this.enable + ", ip='" + this.ip + "', port=" + this.port + ", net=" + this.net + ", net_name='" + this.net_name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/pic/ChannelPicConfig.java b/app/src/main/java/com/dowse/base/param/pic/ChannelPicConfig.java deleted file mode 100644 index 0f080790..00000000 --- a/app/src/main/java/com/dowse/base/param/pic/ChannelPicConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.dowse.base.param.pic; - -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/pic/ChannelPicConfig.class */ -public class ChannelPicConfig { - private List picParams; - - public List getPicParams() { - return this.picParams; - } - - public void setPicParams(List picParams) { - this.picParams = picParams; - } - - public String toString() { - return "ChannelPicConfig{picParams=" + this.picParams + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/pic/ChannelPicParam.java b/app/src/main/java/com/dowse/base/param/pic/ChannelPicParam.java deleted file mode 100644 index 4b31691c..00000000 --- a/app/src/main/java/com/dowse/base/param/pic/ChannelPicParam.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.dowse.base.param.pic; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/pic/ChannelPicParam.class */ -public class ChannelPicParam { - private int width; - private int height; - private int color; - private int luminance; - private int contrast; - private int saturation; - private int compress_radio; - - public int getWidth() { - return this.width; - } - - public void setWidth(int width) { - this.width = width; - } - - public int getHeight() { - return this.height; - } - - public void setHeight(int height) { - this.height = height; - } - - public int getColor() { - return this.color; - } - - public void setColor(int color) { - this.color = color; - } - - public int getLuminance() { - return this.luminance; - } - - public void setLuminance(int luminance) { - this.luminance = luminance; - } - - public int getContrast() { - return this.contrast; - } - - public void setContrast(int contrast) { - this.contrast = contrast; - } - - public int getSaturation() { - return this.saturation; - } - - public void setSaturation(int saturation) { - this.saturation = saturation; - } - - public int getCompress_radio() { - return this.compress_radio; - } - - public void setCompress_radio(int compress_radio) { - this.compress_radio = compress_radio; - } - - public String toString() { - return "ChannelPicParam{width=" + this.width + ", height=" + this.height + ", color=" + this.color + ", luminance=" + this.luminance + ", contrast=" + this.contrast + ", saturation=" + this.saturation + ", compress_radio=" + this.compress_radio + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/pic/DSPicParam.java b/app/src/main/java/com/dowse/base/param/pic/DSPicParam.java deleted file mode 100644 index a3b28507..00000000 --- a/app/src/main/java/com/dowse/base/param/pic/DSPicParam.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.dowse.base.param.pic; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/pic/DSPicParam.class */ -public class DSPicParam { - private int channel; - private ChannelPicParam channelPicParam; - - public int getChannel() { - return this.channel; - } - - public void setChannel(int channel) { - this.channel = channel; - } - - public ChannelPicParam getChannelPicParam() { - return this.channelPicParam; - } - - public void setChannelPicParam(ChannelPicParam channelPicParam) { - this.channelPicParam = channelPicParam; - } - - public String toString() { - return "DSPicParam{channel=" + this.channel + ", channelPicParam=" + this.channelPicParam + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordConfig.java b/app/src/main/java/com/dowse/base/param/record/RecordConfig.java deleted file mode 100644 index 8a9962f0..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.dowse.base.param.record; - -import com.dowse.base.param.device.DeviceType; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordConfig.class */ -public class RecordConfig { - private DeviceType deviceType; - private List configs; - - public DeviceType getDeviceType() { - return this.deviceType; - } - - public void setDeviceType(DeviceType deviceType) { - this.deviceType = deviceType; - } - - public List getConfigs() { - return this.configs; - } - - public void setConfigs(List configs) { - this.configs = configs; - } - - public String toString() { - return "RecordConfig{deviceType=" + this.deviceType + ", configs=" + this.configs + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordDay.java b/app/src/main/java/com/dowse/base/param/record/RecordDay.java deleted file mode 100644 index 18689a28..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordDay.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.dowse.base.param.record; - -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordDay.class */ -public class RecordDay { - private WeekType day; - private List times; - private boolean is_open; - - public WeekType getDay() { - return this.day; - } - - public void setDay(WeekType day) { - this.day = day; - } - - public List getTimes() { - return this.times; - } - - public boolean isIs_open() { - return this.is_open; - } - - public void setIs_open(boolean is_open) { - this.is_open = is_open; - } - - public void setTimes(List times) { - this.times = times; - } - - public String toString() { - return "RecordDay{day=" + this.day + ", times=" + this.times + ", is_open=" + this.is_open + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordFileInfo.java b/app/src/main/java/com/dowse/base/param/record/RecordFileInfo.java deleted file mode 100644 index 7217428d..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordFileInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.dowse.base.param.record; - -import com.dowse.base.param.video.DSChannel; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordFileInfo.class */ -public class RecordFileInfo { - private DSChannel channel; - private RecordInfo recordInfo; - private List datas; - - public List getDatas() { - return this.datas; - } - - public void setDatas(List datas) { - this.datas = datas; - } - - public DSChannel getChannel() { - return this.channel; - } - - public void setChannel(DSChannel channel) { - this.channel = channel; - } - - public RecordInfo getRecordInfo() { - return this.recordInfo; - } - - public void setRecordInfo(RecordInfo recordInfo) { - this.recordInfo = recordInfo; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordInfo.java b/app/src/main/java/com/dowse/base/param/record/RecordInfo.java deleted file mode 100644 index 851429b2..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordInfo.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.dowse.base.param.record; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordInfo.class */ -public class RecordInfo { - private int max_item_size; - private int max_item_time; - private long max_total_size; - private String file_dir; - - public int getMax_item_size() { - return this.max_item_size; - } - - public void setMax_item_size(int max_item_size) { - this.max_item_size = max_item_size; - } - - public int getMax_item_time() { - return this.max_item_time; - } - - public void setMax_item_time(int max_item_time) { - this.max_item_time = max_item_time; - } - - public long getMax_total_size() { - return this.max_total_size; - } - - public void setMax_total_size(long max_total_size) { - this.max_total_size = max_total_size; - } - - public String getFile_dir() { - return this.file_dir; - } - - public void setFile_dir(String file_dir) { - this.file_dir = file_dir; - } - - public String toString() { - return "RecordInfo{max_item_size=" + this.max_item_size + ", max_item_time=" + this.max_item_time + ", max_total_size=" + this.max_total_size + ", file_dir='" + this.file_dir + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordItem.java b/app/src/main/java/com/dowse/base/param/record/RecordItem.java deleted file mode 100644 index b3db2780..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordItem.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.dowse.base.param.record; - -import com.dowse.base.param.audio.AudioForamt; -import com.dowse.base.param.video.VideoForamt; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordItem.class */ -public class RecordItem { - private int no; - private String video_filePath; - private String audio_filePath; - private RecordStatus status; - private VideoForamt video_format; - private AudioForamt audio_format; - private long startTime; - private long endTime; - - public int getNo() { - return this.no; - } - - public void setNo(int no) { - this.no = no; - } - - public String getVideo_filePath() { - return this.video_filePath; - } - - public void setVideo_filePath(String video_filePath) { - this.video_filePath = video_filePath; - } - - public String getAudio_filePath() { - return this.audio_filePath; - } - - public void setAudio_filePath(String audio_filePath) { - this.audio_filePath = audio_filePath; - } - - public RecordStatus getStatus() { - return this.status; - } - - public void setStatus(RecordStatus status) { - this.status = status; - } - - public VideoForamt getVideo_format() { - return this.video_format; - } - - public void setVideo_format(VideoForamt video_format) { - this.video_format = video_format; - } - - public AudioForamt getAudio_format() { - return this.audio_format; - } - - public void setAudio_format(AudioForamt audio_format) { - this.audio_format = audio_format; - } - - public long getStartTime() { - return this.startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - } - - public long getEndTime() { - return this.endTime; - } - - public void setEndTime(long endTime) { - this.endTime = endTime; - } - - public String toString() { - return "RecordItem{no=" + this.no + ", video_filePath='" + this.video_filePath + "', audio_filePath='" + this.audio_filePath + "', status=" + this.status + ", video_format=" + this.video_format + ", audio_format=" + this.audio_format + ", startTime=" + this.startTime + ", endTime=" + this.endTime + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordParam.java b/app/src/main/java/com/dowse/base/param/record/RecordParam.java deleted file mode 100644 index 9c7675cf..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordParam.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.dowse.base.param.record; - -import com.dowse.base.param.video.DSChannel; -import com.dowse.base.param.video.StreamType; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordParam.class */ -public class RecordParam { - private DSChannel channel; - private StreamType stream_no; - private boolean is_open; - private List config; - - public DSChannel getChannel() { - return this.channel; - } - - public void setChannel(DSChannel channel) { - this.channel = channel; - } - - public StreamType getStream_no() { - return this.stream_no; - } - - public void setStream_no(StreamType stream_no) { - this.stream_no = stream_no; - } - - public boolean isIs_open() { - return this.is_open; - } - - public void setIs_open(boolean is_open) { - this.is_open = is_open; - } - - public List getConfig() { - return this.config; - } - - public void setConfig(List config) { - this.config = config; - } - - public String toString() { - return "RecordParam{channel=" + this.channel + ", stream_no=" + this.stream_no + ", is_open=" + this.is_open + ", config=" + this.config + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordStatus.java b/app/src/main/java/com/dowse/base/param/record/RecordStatus.java deleted file mode 100644 index 21db4c2b..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordStatus.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.dowse.base.param.record; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordStatus.class */ -public enum RecordStatus { - R_EMPTY(0, "none"), - R_ING(1, "doing"), - R_DONE(2, "done"); - - private int status; - private String name; - - RecordStatus(int status, String name) { - this.status = status; - this.name = name; - } - - public int getStatus() { - return this.status; - } - - public void setStatus(int status) { - this.status = status; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/RecordTime.java b/app/src/main/java/com/dowse/base/param/record/RecordTime.java deleted file mode 100644 index 0a399a4c..00000000 --- a/app/src/main/java/com/dowse/base/param/record/RecordTime.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dowse.base.param.record; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/RecordTime.class */ -public class RecordTime { - private int start_time; - private int end_time; - private boolean is_open; - - public boolean isIs_open() { - return this.is_open; - } - - public void setIs_open(boolean is_open) { - this.is_open = is_open; - } - - public int getStart_time() { - return this.start_time; - } - - public void setStart_time(int start_time) { - this.start_time = start_time; - } - - public int getEnd_time() { - return this.end_time; - } - - public void setEnd_time(int end_time) { - this.end_time = end_time; - } - - public String toString() { - return "RecordTime{start_time=" + this.start_time + ", end_time=" + this.end_time + ", is_open=" + this.is_open + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/record/WeekType.java b/app/src/main/java/com/dowse/base/param/record/WeekType.java deleted file mode 100644 index 070a7785..00000000 --- a/app/src/main/java/com/dowse/base/param/record/WeekType.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.dowse.base.param.record; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/record/WeekType.class */ -public enum WeekType { - Monday(0, "Monday"), - Tuesday(1, "Tuesday"), - Wednesday(2, "Wednesday"), - Thursday(3, "Tuesday"), - Friday(4, "Monday"), - Saturday(5, "Saturday"), - Sunday(6, "Sunday"), - All(7, "All"); - - private int day; - private String name; - - WeekType(int day, String name) { - this.day = day; - this.name = name; - } - - public int getDay() { - return this.day; - } - - public void setDay(int day) { - this.day = day; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - @Override // java.lang.Enum - public String toString() { - return "WeekType{day=" + this.day + ", name='" + this.name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/ChannelConfig.java b/app/src/main/java/com/dowse/base/param/video/ChannelConfig.java deleted file mode 100644 index af7a05ad..00000000 --- a/app/src/main/java/com/dowse/base/param/video/ChannelConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.dowse.base.param.video; - -import com.dowse.base.param.device.DeviceType; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/ChannelConfig.class */ -public class ChannelConfig { - private DeviceType deviceType; - private List channels; - - public DeviceType getDeviceType() { - return this.deviceType; - } - - public void setDeviceType(DeviceType deviceType) { - this.deviceType = deviceType; - } - - public List getChannels() { - return this.channels; - } - - public void setChannels(List channels) { - this.channels = channels; - } - - public String toString() { - return "ChannelConfig{deviceType=" + this.deviceType + ", channels=" + this.channels + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/ChannelConst.java b/app/src/main/java/com/dowse/base/param/video/ChannelConst.java deleted file mode 100644 index 96462215..00000000 --- a/app/src/main/java/com/dowse/base/param/video/ChannelConst.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/ChannelConst.class */ -public interface ChannelConst { - public static final int FACING_RV1126 = -1; - public static final int MTK_FACING_BACK = 0; - public static final int MTK_FACING_FRONT = 1; -} diff --git a/app/src/main/java/com/dowse/base/param/video/ChannelOSD.java b/app/src/main/java/com/dowse/base/param/video/ChannelOSD.java deleted file mode 100644 index 4fea7f93..00000000 --- a/app/src/main/java/com/dowse/base/param/video/ChannelOSD.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.dowse.base.param.video; - -import java.util.Arrays; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/ChannelOSD.class */ -public class ChannelOSD { - private boolean timeEnable; - private boolean infoEnable; - private TextOSD[] textOSDS; - - public boolean isTimeEnable() { - return this.timeEnable; - } - - public void setTimeEnable(boolean timeEnable) { - this.timeEnable = timeEnable; - } - - public boolean isInfoEnable() { - return this.infoEnable; - } - - public void setInfoEnable(boolean infoEnable) { - this.infoEnable = infoEnable; - } - - public TextOSD[] getTextOSDS() { - return this.textOSDS; - } - - public void setTextOSDS(TextOSD[] textOSDS) { - this.textOSDS = textOSDS; - } - - public String toString() { - return "ChannelOSD{timeEnable=" + this.timeEnable + ", infoEnable=" + this.infoEnable + ", textOSDS=" + Arrays.toString(this.textOSDS) + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/ChannelOSDConfig.java b/app/src/main/java/com/dowse/base/param/video/ChannelOSDConfig.java deleted file mode 100644 index 702f6203..00000000 --- a/app/src/main/java/com/dowse/base/param/video/ChannelOSDConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.dowse.base.param.video; - -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/ChannelOSDConfig.class */ -public class ChannelOSDConfig { - private List osdList; - - public List getOsdList() { - return this.osdList; - } - - public void setOsdList(List osdList) { - this.osdList = osdList; - } - - public String toString() { - return "ChannelOSDConfig{osdList=" + this.osdList + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/ChannelType.java b/app/src/main/java/com/dowse/base/param/video/ChannelType.java deleted file mode 100644 index 48b0db6e..00000000 --- a/app/src/main/java/com/dowse/base/param/video/ChannelType.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/ChannelType.class */ -public enum ChannelType { - RV1126_CAMERA_0(0, -1, "rv1126 main camera", 0), - RV1126_CAMERA_1(1, -1, "rv1126 sub camera", 1), - MTK_CAMERA_FRONT_1(2, 1, "mt8788 front 1", 0), - MTK_CAMERA_FRONT_2(3, 1, "mt8788 front 2", 1), - MTK_CAMERA_FRONT_3(4, 1, "mt8788 front 3", 2), - MTK_CAMERA_BACK_1(5, 0, "mt8788 back 1", 0), - MTK_CAMERA_BACK_2(6, 0, "mt8788 back 2", 1); - - private int no; - private String name; - private int index; - private int facing; - - ChannelType(int no, int facing, String name, int index) { - this.no = no; - this.facing = facing; - this.name = name; - this.index = index; - } - - public int getNo() { - return this.no; - } - - public void setNo(int no) { - this.no = no; - } - - public int getFacing() { - return this.facing; - } - - public void setFacing(int facing) { - this.facing = facing; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public int getIndex() { - return this.index; - } - - public void setIndex(int index) { - this.index = index; - } - - @Override // java.lang.Enum - public String toString() { - return "ChannelType{no=" + this.no + ", name='" + this.name + "', index=" + this.index + ", facing=" + this.facing + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/ChannelVideoConfig.java b/app/src/main/java/com/dowse/base/param/video/ChannelVideoConfig.java deleted file mode 100644 index 12303058..00000000 --- a/app/src/main/java/com/dowse/base/param/video/ChannelVideoConfig.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.dowse.base.param.video; - -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/ChannelVideoConfig.class */ -public class ChannelVideoConfig { - private List videoParams; - - public List getVideoParams() { - return this.videoParams; - } - - public void setVideoParams(List videoParams) { - this.videoParams = videoParams; - } - - public String toString() { - return "ChannelVideoConfig{videoParams=" + this.videoParams + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/ChannelVideoParam.java b/app/src/main/java/com/dowse/base/param/video/ChannelVideoParam.java deleted file mode 100644 index a765cbd4..00000000 --- a/app/src/main/java/com/dowse/base/param/video/ChannelVideoParam.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/ChannelVideoParam.class */ -public class ChannelVideoParam { - private int bit_rate; - private int frame_rate; - private int i_frame_interval; - - public int getBit_rate() { - return this.bit_rate; - } - - public void setBit_rate(int bit_rate) { - this.bit_rate = bit_rate; - } - - public int getFrame_rate() { - return this.frame_rate; - } - - public void setFrame_rate(int frame_rate) { - this.frame_rate = frame_rate; - } - - public int getI_frame_interval() { - return this.i_frame_interval; - } - - public void setI_frame_interval(int i_frame_interval) { - this.i_frame_interval = i_frame_interval; - } - - public String toString() { - return "ChannelVideoParam{bit_rate=" + this.bit_rate + ", frame_rate=" + this.frame_rate + ", i_frame_interval=" + this.i_frame_interval + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/DSChannel.java b/app/src/main/java/com/dowse/base/param/video/DSChannel.java deleted file mode 100644 index 25feff16..00000000 --- a/app/src/main/java/com/dowse/base/param/video/DSChannel.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.dowse.base.param.video; - -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/DSChannel.class */ -public class DSChannel { - private ChannelType channelType; - private boolean enable; - private int channel; - private int sdk_channel; - private List streams; - - public ChannelType getChannelType() { - return this.channelType; - } - - public void setChannelType(ChannelType channelType) { - this.channelType = channelType; - } - - public boolean isEnable() { - return this.enable; - } - - public void setEnable(boolean enable) { - this.enable = enable; - } - - public int getChannel() { - return this.channel; - } - - public void setChannel(int channel) { - this.channel = channel; - } - - public int getSdk_channel() { - return this.sdk_channel; - } - - public void setSdk_channel(int sdk_channel) { - this.sdk_channel = sdk_channel; - } - - public List getStreams() { - return this.streams; - } - - public void setStreams(List streams) { - this.streams = streams; - } - - public String toString() { - return "DSChannel{channelType=" + this.channelType + ", enable=" + this.enable + ", channel=" + this.channel + ", sdk_channel=" + this.sdk_channel + ", streams=" + this.streams + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/DSOSDParam.java b/app/src/main/java/com/dowse/base/param/video/DSOSDParam.java deleted file mode 100644 index 0912d8d3..00000000 --- a/app/src/main/java/com/dowse/base/param/video/DSOSDParam.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/DSOSDParam.class */ -public class DSOSDParam { - private int channel; - private ChannelOSD channelOSD; - - public int getChannel() { - return this.channel; - } - - public void setChannel(int channel) { - this.channel = channel; - } - - public ChannelOSD getChannelOSD() { - return this.channelOSD; - } - - public void setChannelOSD(ChannelOSD channelOSD) { - this.channelOSD = channelOSD; - } - - public String toString() { - return "DSOSDParam{channel=" + this.channel + ", channelOSD=" + this.channelOSD + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/DSStream.java b/app/src/main/java/com/dowse/base/param/video/DSStream.java deleted file mode 100644 index 1b9094d6..00000000 --- a/app/src/main/java/com/dowse/base/param/video/DSStream.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/DSStream.class */ -public class DSStream { - private StreamType streamType; - private boolean support; - - public StreamType getStreamType() { - return this.streamType; - } - - public void setStreamType(StreamType streamType) { - this.streamType = streamType; - } - - public boolean isSupport() { - return this.support; - } - - public void setSupport(boolean support) { - this.support = support; - } - - public String toString() { - return "DSStream{streamType=" + this.streamType + ", support=" + this.support + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/DSVideoParam.java b/app/src/main/java/com/dowse/base/param/video/DSVideoParam.java deleted file mode 100644 index 26c0ee8c..00000000 --- a/app/src/main/java/com/dowse/base/param/video/DSVideoParam.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/DSVideoParam.class */ -public class DSVideoParam { - private int channel; - private ChannelVideoParam channelVideoParam; - - public int getChannel() { - return this.channel; - } - - public void setChannel(int channel) { - this.channel = channel; - } - - public ChannelVideoParam getChannelVideoParam() { - return this.channelVideoParam; - } - - public void setChannelVideoParam(ChannelVideoParam channelVideoParam) { - this.channelVideoParam = channelVideoParam; - } - - public String toString() { - return "DSVideoParam{channel=" + this.channel + ", channelVideoParam=" + this.channelVideoParam + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/StreamType.java b/app/src/main/java/com/dowse/base/param/video/StreamType.java deleted file mode 100644 index d2829106..00000000 --- a/app/src/main/java/com/dowse/base/param/video/StreamType.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/StreamType.class */ -public enum StreamType { - MAIN_STREAM(0, 1920, 1080, "main", "1920x1080"), - SUB_STREAM(1, 1280, 720, "sub", "1280×720"), - THIRD_STREAM(2, 640, 480, "third", "640X480"); - - private int stream_no; - private int width; - private int height; - private String name; - private String resolution; - - StreamType(int stream_no, int width, int height, String name, String resolution) { - this.stream_no = stream_no; - this.width = width; - this.height = height; - this.name = name; - this.resolution = resolution; - } - - public String getResolution() { - return this.resolution; - } - - public void setResolution(String resolution) { - this.resolution = resolution; - } - - public int getStream_no() { - return this.stream_no; - } - - public void setStream_no(int stream_no) { - this.stream_no = stream_no; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public int getWidth() { - return this.width; - } - - public void setWidth(int width) { - this.width = width; - } - - public int getHeight() { - return this.height; - } - - public void setHeight(int height) { - this.height = height; - } - - @Override // java.lang.Enum - public String toString() { - return "StreamType{stream_no=" + this.stream_no + ", width=" + this.width + ", height=" + this.height + ", name='" + this.name + "', resolution='" + this.resolution + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/TextOSD.java b/app/src/main/java/com/dowse/base/param/video/TextOSD.java deleted file mode 100644 index 5f7a27f5..00000000 --- a/app/src/main/java/com/dowse/base/param/video/TextOSD.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/TextOSD.class */ -public class TextOSD { - private boolean enable; - private String content; - private int startX; - private int startY; - private float r; - private float g; - private float b; - private int scale; - - public int getScale() { - return this.scale; - } - - public void setScale(int scale) { - this.scale = scale; - } - - public boolean isEnable() { - return this.enable; - } - - public void setEnable(boolean enable) { - this.enable = enable; - } - - public String getContent() { - return this.content; - } - - public void setContent(String content) { - this.content = content.trim() + " "; - } - - public int getStartX() { - return this.startX; - } - - public void setStartX(int startX) { - this.startX = startX; - } - - public int getStartY() { - return this.startY; - } - - public void setStartY(int startY) { - this.startY = startY; - } - - public float getR() { - return this.r; - } - - public void setR(float r) { - this.r = r; - } - - public float getG() { - return this.g; - } - - public void setG(float g) { - this.g = g; - } - - public float getB() { - return this.b; - } - - public void setB(float b) { - this.b = b; - } - - public String toString() { - return "DSTextOSD{enable=" + this.enable + ", content='" + this.content + "', startX=" + this.startX + ", startY=" + this.startY + ", r=" + this.r + ", g=" + this.g + ", b=" + this.b + ", scale=" + this.scale + '}'; - } -} diff --git a/app/src/main/java/com/dowse/base/param/video/VideoForamt.java b/app/src/main/java/com/dowse/base/param/video/VideoForamt.java deleted file mode 100644 index b1531f5d..00000000 --- a/app/src/main/java/com/dowse/base/param/video/VideoForamt.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dowse.base.param.video; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/param/video/VideoForamt.class */ -public enum VideoForamt { - V_H264(0, "H.264"), - V_H265(1, "H.265"); - - private int type; - private String name; - - VideoForamt(int type, String name) { - this.type = type; - this.name = name; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - public int getType() { - return this.type; - } - - public void setType(int type) { - this.type = type; - } - - @Override // java.lang.Enum - public String toString() { - return "VideoForamt{type=" + this.type + ", name='" + this.name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/service/DSRemoteService.java b/app/src/main/java/com/dowse/base/service/DSRemoteService.java deleted file mode 100644 index 6f6d3d08..00000000 --- a/app/src/main/java/com/dowse/base/service/DSRemoteService.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.dowse.base.service; - -import android.app.Service; -import android.content.Intent; -import android.content.ServiceConnection; -import android.os.IBinder; -import com.dowse.base.log.DSLog; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/service/DSRemoteService.class */ -public class DSRemoteService extends Service { - private static final String TAG = "DSRemoteService"; - - @Override // android.app.Service - public void onCreate() { - DSLog.d(TAG, "onCreate"); - super.onCreate(); - } - - @Override // android.app.Service - public int onStartCommand(Intent intent, int flags, int startId) { - return 1; - } - - @Override // android.app.Service - public IBinder onBind(Intent intent) { - DSLog.d(TAG, "onBind"); - return DSRemoteServiceManager.getInstance().getCallBack(); - } - - @Override // android.content.ContextWrapper, android.content.Context - public void unbindService(ServiceConnection conn) { - DSLog.d(TAG, "unbindService"); - super.unbindService(conn); - } -} diff --git a/app/src/main/java/com/dowse/base/service/DSRemoteServiceManager.java b/app/src/main/java/com/dowse/base/service/DSRemoteServiceManager.java deleted file mode 100644 index aab8af84..00000000 --- a/app/src/main/java/com/dowse/base/service/DSRemoteServiceManager.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.dowse.base.service; - -import com.dowse.base.IRemote; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/service/DSRemoteServiceManager.class */ -public class DSRemoteServiceManager { - private static final String TAG = "DSRemoteServiceManager"; - private IRemote.Stub mCallBack = null; - - public static DSRemoteServiceManager getInstance() { - return DSRemoteServiceManagerHolder.instance; - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/service/DSRemoteServiceManager$DSRemoteServiceManagerHolder.class */ - private static class DSRemoteServiceManagerHolder { - public static final DSRemoteServiceManager instance = new DSRemoteServiceManager(); - - private DSRemoteServiceManagerHolder() { - } - } - - public IRemote.Stub getCallBack() { - return this.mCallBack; - } - - public void setCallBack(IRemote.Stub mCallBack) { - this.mCallBack = mCallBack; - } -} diff --git a/app/src/main/java/com/dowse/base/service/RemoteFunID.java b/app/src/main/java/com/dowse/base/service/RemoteFunID.java deleted file mode 100644 index 4c76adc3..00000000 --- a/app/src/main/java/com/dowse/base/service/RemoteFunID.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.dowse.base.service; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/service/RemoteFunID.class */ -public enum RemoteFunID { - NOTIFY_I1_PARAM_CHANGE(0, "Notify I1 Param Change"), - NOTIFY_MAINTENANCE_PARAM_CHANGE(1, "Notify Maintenance Change"), - NOTIFY_AI_GET_REG_CODE(2, "Notify GET AI Reg Code"), - NOTIFY_AI_SET_CD_KEY(3, "Notify SET AI CD KEY"), - NOTIFY_I1_TAKE_VIDEO(4, "Notify TAKE VIDEO"), - NOTIFY_I1_TAKE_PIC(5, "Notify TAKE PIC"); - - private int funcId; - private String name; - - RemoteFunID(int funcId, String name) { - this.funcId = funcId; - this.name = name; - } - - public int getFuncId() { - return this.funcId; - } - - public void setFuncId(int funcId) { - this.funcId = funcId; - } - - public String getName() { - return this.name; - } - - public void setName(String name) { - this.name = name; - } - - @Override // java.lang.Enum - public String toString() { - return "RemoteFunID{funcId=" + this.funcId + ", name='" + this.name + "'}"; - } -} diff --git a/app/src/main/java/com/dowse/base/util/APKUtil.java b/app/src/main/java/com/dowse/base/util/APKUtil.java deleted file mode 100644 index 5491d9ce..00000000 --- a/app/src/main/java/com/dowse/base/util/APKUtil.java +++ /dev/null @@ -1,288 +0,0 @@ -package com.dowse.base.util; - -import android.annotation.TargetApi; -import android.app.ActivityManager; -import android.app.PendingIntent; -import android.content.ActivityNotFoundException; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.content.pm.PackageInfo; -import android.content.pm.PackageInstaller; -import android.content.pm.PackageManager; -import com.dowse.base.log.DSLog; -import java.io.BufferedReader; -import java.io.Closeable; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.lang.reflect.Method; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/APKUtil.class */ -public class APKUtil { - private static final String TAG = "APKUpdate"; - - private static void output(Process mProcess) { - try { - BufferedReader mReader = new BufferedReader(new InputStreamReader(mProcess.getInputStream())); - while (true) { - String msg = mReader.readLine(); - if (msg != null) { - DSLog.e(TAG, "mProcess result:" + msg); - } else { - mReader.close(); - return; - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - public static void installAPK2(Context context, String apkFilePath) { - String installCmd = "pm install -r " + apkFilePath; - try { - Process mProcess = Runtime.getRuntime().exec(installCmd); - mProcess.waitFor(); - int return_value = mProcess.exitValue(); - DSLog.e(TAG, "mProcess result exitValue:" + return_value); - output(mProcess); - } catch (Exception e) { - e.printStackTrace(); - DSLog.e(TAG, "installAPK2 Exception " + e.getMessage()); - } - } - - public static String getPackageName(Context context, String filePath) { - String packageName = ""; - PackageManager pm = context.getPackageManager(); - PackageInfo info = pm.getPackageArchiveInfo(filePath, 1); - if (info != null) { - packageName = info.packageName; - } - return packageName; - } - - @TargetApi(21) - public static void installAPK(Context context, String apkFilePath) { - DSLog.d(TAG, "--->>>install()--->>> apkFilePath:" + apkFilePath); - PackageManager packageManager = context.getPackageManager(); - registerAndroidPackageReceiver(context); - File apkFile = new File(apkFilePath); - PackageInstaller packageInstaller = packageManager.getPackageInstaller(); - PackageInstaller.SessionParams sessionParams = new PackageInstaller.SessionParams(1); - sessionParams.setSize(apkFile.length()); - packageInstaller.registerSessionCallback(new PackageInstaller.SessionCallback() { // from class: com.dowse.base.util.APKUtil.1 - @Override // android.content.pm.PackageInstaller.SessionCallback - public void onCreated(int sessionId) { - DSLog.d(APKUtil.TAG, "--->>>onCreated()--->>> sessionId:" + sessionId); - } - - @Override // android.content.pm.PackageInstaller.SessionCallback - public void onBadgingChanged(int sessionId) { - DSLog.d(APKUtil.TAG, "--->>>onBadgingChanged()--->>> sessionId:" + sessionId); - } - - @Override // android.content.pm.PackageInstaller.SessionCallback - public void onActiveChanged(int sessionId, boolean active) { - DSLog.d(APKUtil.TAG, "--->>>onActiveChanged()--->>> sessionId:" + sessionId + ",active:" + active); - } - - @Override // android.content.pm.PackageInstaller.SessionCallback - public void onProgressChanged(int sessionId, float progress) { - DSLog.d(APKUtil.TAG, "--->>>onProgressChanged()--->>> sessionId:" + sessionId + ",progress:" + progress); - } - - @Override // android.content.pm.PackageInstaller.SessionCallback - public void onFinished(int sessionId, boolean success) { - DSLog.d(APKUtil.TAG, "--->>>onFinished()--->>> sessionId:" + sessionId + ",success: " + success); - } - }); - int sessionId = createSession(packageInstaller, sessionParams); - if (sessionId != -1) { - boolean copySuccess = copyInstallFile(packageInstaller, sessionId, apkFilePath); - DSLog.d(TAG, "--->>>install28()--->>> copy Success apkFilePath:" + apkFilePath); - if (copySuccess) { - execInstallCommand(context, packageInstaller, sessionId); - if (getPackageName(context, apkFilePath).equals("com.dowse.camera")) { - reboot(context); - } - } - } - } - - public static void reboot(Context context) { - Intent reboot = new Intent("android.intent.action.REBOOT"); - reboot.putExtra("nowait", 1); - reboot.putExtra("interval", 1); - reboot.putExtra("window", 0); - context.sendBroadcast(reboot); - } - - @TargetApi(21) - private static int createSession(PackageInstaller packageInstaller, PackageInstaller.SessionParams sessionParams) { - int sessionId = -1; - try { - sessionId = packageInstaller.createSession(sessionParams); - } catch (IOException e) { - e.printStackTrace(); - } - return sessionId; - } - - private static void registerAndroidPackageReceiver(Context context) { - IntentFilter installFilter = new IntentFilter(); - installFilter.addAction("android.content.pm.extra.STATUS"); - InstallResultReceiver installResultReceiver = new InstallResultReceiver(); - context.registerReceiver(installResultReceiver, installFilter); - } - - @TargetApi(21) - private static boolean copyInstallFile(PackageInstaller packageInstaller, int sessionId, String apkFilePath) { - DSLog.d(TAG, "--->>>copyInstallFile()--->>> sessionId:" + sessionId + ", apkFilePath:" + apkFilePath); - InputStream in = null; - OutputStream out = null; - PackageInstaller.Session session = null; - boolean success = false; - try { - try { - File apkFile = new File(apkFilePath); - session = packageInstaller.openSession(sessionId); - out = session.openWrite("base.apk", 0L, apkFile.length()); - in = new FileInputStream(apkFile); - int total = 0; - byte[] buffer = new byte[65536]; - while (true) { - int c = in.read(buffer); - if (c == -1) { - break; - } - total += c; - out.write(buffer, 0, c); - } - session.fsync(out); - DSLog.i(TAG, "streamed " + total + " bytes"); - success = true; - IoUtils.closeQuietly(out); - IoUtils.closeQuietly(in); - IoUtils.closeQuietly(session); - } catch (IOException e) { - e.printStackTrace(); - IoUtils.closeQuietly(out); - IoUtils.closeQuietly(in); - IoUtils.closeQuietly(session); - } - return success; - } catch (Throwable th) { - IoUtils.closeQuietly(out); - IoUtils.closeQuietly(in); - IoUtils.closeQuietly(session); - throw th; - } - } - - @TargetApi(21) - private static void execInstallCommand(Context context, PackageInstaller packageInstaller, int sessionId) { - DSLog.d(TAG, "--->>>execInstallCommand()--->>> sessionId:" + sessionId); - PackageInstaller.Session session = null; - try { - try { - session = packageInstaller.openSession(sessionId); - Intent intent = new Intent(context, InstallResultReceiver.class); - PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 1, intent, 134217728); - session.commit(pendingIntent.getIntentSender()); - IoUtils.closeQuietly(session); - } catch (IOException e) { - e.printStackTrace(); - IoUtils.closeQuietly(session); - } - } catch (Throwable th) { - IoUtils.closeQuietly(session); - throw th; - } - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/APKUtil$IoUtils.class */ - public static final class IoUtils { - public static void closeQuietly(Closeable c) { - if (c != null) { - try { - c.close(); - } catch (IOException ignored) { - ignored.printStackTrace(); - } - } - } - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/APKUtil$InstallResultReceiver.class */ - public static class InstallResultReceiver extends BroadcastReceiver { - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - DSLog.d(APKUtil.TAG, "onReceive() -> intent: " + intent.getAction()); - if (intent != null) { - int status = intent.getIntExtra("android.content.pm.extra.STATUS", 1); - if (status == 0) { - DSLog.d(APKUtil.TAG, "onReceive -> install success"); - } else { - DSLog.d(APKUtil.TAG, "onReceive -> install fail"); - } - } - context.unregisterReceiver(this); - } - } - - public static void startAPK(Context mContext, String packageName) { - Intent mainIntent = mContext.getPackageManager().getLaunchIntentForPackage(packageName); - if (mainIntent == null) { - return; - } - mainIntent.addFlags(268435456); - try { - mContext.startActivity(mainIntent); - DSLog.d(TAG, "startAPK name = " + packageName); - } catch (ActivityNotFoundException e) { - DSLog.e(TAG, "Package not found!,start failed,package name = " + packageName); - } - } - - public static void stopAPK(Context mContext, String packageName) { - ActivityManager mActivityManager = (ActivityManager) mContext.getSystemService("activity"); - try { - Method method = Class.forName("android.app.ActivityManager").getMethod("forceStopPackage", String.class); - method.invoke(mActivityManager, packageName); - DSLog.d(TAG, "stopAPK name = " + packageName); - } catch (Exception e) { - e.printStackTrace(); - DSLog.e(TAG, "forceStopPackage failed!,package name = " + packageName + ",exception:" + e.getMessage()); - } - } - - public static int getVersionCode(Context context, String packageName) { - PackageManager manager = context.getPackageManager(); - long code = -1; - try { - PackageInfo info = manager.getPackageInfo(packageName, 0); - code = info.getLongVersionCode(); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - return (int) code; - } - - public static String getVersionName(Context context, String packageName) { - PackageManager manager = context.getPackageManager(); - String name = ""; - try { - PackageInfo info = manager.getPackageInfo(packageName, 0); - name = info.versionName; - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - return name; - } -} diff --git a/app/src/main/java/com/dowse/base/util/ContextUtil.java b/app/src/main/java/com/dowse/base/util/ContextUtil.java deleted file mode 100644 index 04c49baa..00000000 --- a/app/src/main/java/com/dowse/base/util/ContextUtil.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.dowse.base.util; - -import android.app.Application; -import android.content.Context; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import com.dowse.base.log.DSLog; -import java.lang.reflect.Method; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/ContextUtil.class */ -public class ContextUtil { - private static final String TAG = "ContextUtil"; - - public static Application getApplication() { - Application application = null; - try { - Class atClass = Class.forName("android.app.ActivityThread"); - Method currentApplicationMethod = atClass.getDeclaredMethod("currentApplication", new Class[0]); - currentApplicationMethod.setAccessible(true); - application = (Application) currentApplicationMethod.invoke(null, new Object[0]); - } catch (Exception e) { - DSLog.d(TAG, "e:" + e.toString()); - } - if (application != null) { - return application; - } - try { - Class atClass2 = Class.forName("android.app.AppGlobals"); - Method currentApplicationMethod2 = atClass2.getDeclaredMethod("getInitialApplication", new Class[0]); - currentApplicationMethod2.setAccessible(true); - application = (Application) currentApplicationMethod2.invoke(null, new Object[0]); - } catch (Exception e2) { - DSLog.d(TAG, "e:" + e2.toString()); - } - return application; - } - - public static int getVersionCode(Context context, String packageName) { - PackageManager manager = context.getPackageManager(); - long code = -1; - try { - PackageInfo info = manager.getPackageInfo(packageName, 0); - code = info.getLongVersionCode(); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - return (int) code; - } - - public static String getVersionName(Context context, String packageName) { - PackageManager manager = context.getPackageManager(); - String name = ""; - try { - PackageInfo info = manager.getPackageInfo(packageName, 0); - name = info.versionName; - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - return name; - } -} diff --git a/app/src/main/java/com/dowse/base/util/DSBaseWork.java b/app/src/main/java/com/dowse/base/util/DSBaseWork.java deleted file mode 100644 index c6d698cf..00000000 --- a/app/src/main/java/com/dowse/base/util/DSBaseWork.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.dowse.base.util; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/DSBaseWork.class */ -public class DSBaseWork { - private boolean isStop = false; - - public boolean isStop() { - return this.isStop; - } - - public void setStop(boolean stop) { - this.isStop = stop; - } -} diff --git a/app/src/main/java/com/dowse/base/util/DSSchedulers.java b/app/src/main/java/com/dowse/base/util/DSSchedulers.java deleted file mode 100644 index 06f2a457..00000000 --- a/app/src/main/java/com/dowse/base/util/DSSchedulers.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.dowse.base.util; - -import android.app.AlarmManager; -import android.content.Context; -import android.os.Handler; -import android.os.HandlerThread; -import android.text.TextUtils; -import java.util.HashMap; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/DSSchedulers.class */ -public class DSSchedulers { - private static final String TAG = DSSchedulers.class.getSimpleName(); - private AlarmManager mAlarmManager; - private Context mContext; - private Handler mHandler; - private boolean isInit; - private HashMap taskInfoMap; - private HandlerThread mHandlerThread; - - private DSSchedulers() { - this.isInit = false; - this.taskInfoMap = new HashMap<>(); - } - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/DSSchedulers$Holder.class */ - private static class Holder { - public static DSSchedulers INSTANCE = new DSSchedulers(); - - private Holder() { - } - } - - public static DSSchedulers getInstance() { - return Holder.INSTANCE; - } - - public boolean init(Context mContext) { - if (!this.isInit) { - this.mContext = mContext; - this.mHandlerThread = new HandlerThread(TAG); - this.mHandlerThread.start(); - this.mHandler = new Handler(this.mHandlerThread.getLooper()); - this.mAlarmManager = (AlarmManager) mContext.getSystemService("alarm"); - this.isInit = true; - return true; - } - return false; - } - - public void addTask(String taskId, long delay, AlarmManager.OnAlarmListener listener) { - long triggerAtTime = System.currentTimeMillis() + delay; - this.mAlarmManager.setExact(0, triggerAtTime, TAG, listener, this.mHandler); - this.taskInfoMap.put(taskId, listener); - } - - public void cancelTask(String taskId) { - AlarmManager.OnAlarmListener listener; - if (!TextUtils.isEmpty(taskId) && (listener = this.taskInfoMap.get(taskId)) != null) { - this.mAlarmManager.cancel(listener); - } - } -} diff --git a/app/src/main/java/com/dowse/base/util/DeviceUtil.java b/app/src/main/java/com/dowse/base/util/DeviceUtil.java deleted file mode 100644 index ca6f2714..00000000 --- a/app/src/main/java/com/dowse/base/util/DeviceUtil.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.dowse.base.util; - -import android.os.Build; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/DeviceUtil.class */ -public class DeviceUtil { - public static String getSN() { - String sn = "null"; - if (Build.VERSION.SDK_INT < 29) { - if (Build.VERSION.SDK_INT >= 26) { - sn = Build.getSerial(); - } else { - sn = Build.SERIAL; - } - } - return sn; - } - - public static String getSysVer() { - return Build.DISPLAY; - } - - public static String getModel() { - return Build.MODEL; - } - - public static String getHardVer() { - if (getModel().equals("D6")) { - return "D6-MTK8788-MB-V2.3"; - } - return "V2.3"; - } -} diff --git a/app/src/main/java/com/dowse/base/util/GPSUtil.java b/app/src/main/java/com/dowse/base/util/GPSUtil.java deleted file mode 100644 index c4488580..00000000 --- a/app/src/main/java/com/dowse/base/util/GPSUtil.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.dowse.base.util; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/GPSUtil.class */ -public class GPSUtil { - public static final int DU = 360000; - public static final int FEN = 6000; - public static final int MIAO = 100; - - public static String getShowValue(int value) { - return getDu(value) + getFen(value) + getMiao(value); - } - - public static String getDu(int value) { - int result = 0; - if (value > 360000) { - result = value / DU; - } - return result + "°"; - } - - public static String getFen(int value) { - int result = 0; - int temp = value % DU; - if (value > 360000) { - if (temp != 0 && temp > 6000) { - result = temp / FEN; - } - } else { - result = value / FEN; - } - return result + "'"; - } - - public static String getMiao(int value) { - int result = 0; - int temp = value % DU; - if (value > 3600) { - if (temp != 0) { - if (temp > 6000) { - if (temp % FEN != 0) { - result = temp % FEN; - } - } else { - result = temp; - } - } - } else if (value % FEN != 0) { - result = value % FEN; - } - return (result / 100) + "''"; - } -} diff --git a/app/src/main/java/com/dowse/base/util/MD5Util.java b/app/src/main/java/com/dowse/base/util/MD5Util.java deleted file mode 100644 index 9bd56306..00000000 --- a/app/src/main/java/com/dowse/base/util/MD5Util.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.dowse.base.util; - -import java.security.MessageDigest; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/MD5Util.class */ -public class MD5Util { - public static String md5(String input) { - try { - byte[] bytes = MessageDigest.getInstance("MD5").digest(input.getBytes()); - return printHexBinary(bytes); - } catch (Exception e) { - return input; - } - } - - public static String printHexBinary(byte[] data) { - StringBuilder r = new StringBuilder(data.length * 2); - for (byte b : data) { - r.append(String.format("%x", new Integer(b & 255))); - } - return r.toString(); - } -} diff --git a/app/src/main/java/com/dowse/base/util/OtaUpdateUtil.java b/app/src/main/java/com/dowse/base/util/OtaUpdateUtil.java deleted file mode 100644 index e31e1bc2..00000000 --- a/app/src/main/java/com/dowse/base/util/OtaUpdateUtil.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.dowse.base.util; - -import android.content.Context; -import android.os.Environment; -import android.os.RecoverySystem; -import com.dowse.base.log.DSLog; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/OtaUpdateUtil.class */ -public class OtaUpdateUtil { - public static final String TAG = "OtaUpdateUtil"; - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/OtaUpdateUtil$ProgressListener.class */ - public interface ProgressListener { - void onProgress(int i, String str); - } - - private File copyFileToCache(ProgressListener progressListener) { - File updateFile = getUdapteFile(); - if (updateFile.exists()) { - progressListener.onProgress(0, "发现ota升级包=" + updateFile.getPath()); - try { - InputStream inStream = new FileInputStream(updateFile); - FileOutputStream fos = new FileOutputStream("/data/update.zip"); - byte[] buf = new byte[1024]; - progressListener.onProgress(0, "正在准备ota升级包, 请稍后..." + updateFile.getPath()); - while (true) { - int length = inStream.read(buf); - if (length != -1) { - fos.write(buf, 0, length); - } else { - inStream.close(); - fos.close(); - return new File("/data/update.zip"); - } - } - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } else { - return null; - } - } - - public File getUdapteFile() { - File updateFile = null; - if (Environment.getExternalStorageState().equals("mounted")) { - File updateFile2 = new File("/sdcard/update.zip"); - if (updateFile2.exists()) { - return updateFile2; - } - File updateFile3 = new File("/mnt/sdcard/update.zip"); - if (updateFile3.exists()) { - return updateFile3; - } - File updateFile4 = new File("/mnt/sdcard1/update.zip"); - if (updateFile4.exists()) { - return updateFile4; - } - updateFile = new File("/storage/sdcard1/update.zip"); - if (updateFile.exists()) { - return updateFile; - } - } - return updateFile; - } - - public void systemUpdate(final Context context, final ProgressListener progressListener) { - final File otaFile = copyFileToCache(progressListener); - if (otaFile == null || !otaFile.exists()) { - DSLog.e(TAG, "ota文件不存在"); - progressListener.onProgress(-1, "ota文件不存在."); - return; - } - DSLog.d(TAG, "升级包:" + otaFile.getAbsoluteFile()); - try { - RecoverySystem.verifyPackage(otaFile, new RecoverySystem.ProgressListener() { // from class: com.dowse.base.util.OtaUpdateUtil.1 - @Override // android.os.RecoverySystem.ProgressListener - public void onProgress(int progress) { - progressListener.onProgress(progress, "验证OTA升级包进度..." + progress); - DSLog.d(OtaUpdateUtil.TAG, "验证OTA升级包进度..." + progress); - if (progress == 100) { - try { - progressListener.onProgress(progress, "开始安装ota升级包."); - DSLog.d(OtaUpdateUtil.TAG, "开始安装ota升级包."); - RecoverySystem.installPackage(context, otaFile); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - }, null); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/app/src/main/java/com/dowse/base/util/StaticIP.java b/app/src/main/java/com/dowse/base/util/StaticIP.java deleted file mode 100644 index f8a3a26e..00000000 --- a/app/src/main/java/com/dowse/base/util/StaticIP.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.dowse.base.util; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/StaticIP.class */ -public class StaticIP { - private String ip; - private String mac; - private String mask; - private String gw; - private String dns1; - private String dns2; - - public String getIp() { - return this.ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getMac() { - return this.mac; - } - - public void setMac(String mac) { - this.mac = mac; - } - - public String getMask() { - return this.mask; - } - - public void setMask(String mask) { - this.mask = mask; - } - - public String getGw() { - return this.gw; - } - - public void setGw(String gw) { - this.gw = gw; - } - - public String getDns1() { - return this.dns1; - } - - public void setDns1(String dns1) { - this.dns1 = dns1; - } - - public String getDns2() { - return this.dns2; - } - - public void setDns2(String dns2) { - this.dns2 = dns2; - } -} diff --git a/app/src/main/java/com/dowse/base/util/TFUtil.java b/app/src/main/java/com/dowse/base/util/TFUtil.java deleted file mode 100644 index 8aad762b..00000000 --- a/app/src/main/java/com/dowse/base/util/TFUtil.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.dowse.base.util; - -import android.content.Context; -import android.os.Environment; -import android.os.StatFs; -import android.os.storage.StorageManager; -import com.dowse.base.log.DSLog; -import java.io.File; -import java.lang.reflect.Method; -import java.util.List; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/TFUtil.class */ -public class TFUtil { - private static final String TAG = "TFUtil"; - static final /* synthetic */ boolean $assertionsDisabled; - - static { - $assertionsDisabled = !TFUtil.class.desiredAssertionStatus(); - } - - public static boolean isExitSDCard() { - if (Environment.getExternalStorageState().equals("mounted")) { - return true; - } - return false; - } - - public static long getLeftSize(String path) { - StatFs sf = new StatFs(path); - long blockSize = sf.getBlockSize(); - long freeBlocks = sf.getAvailableBlocks(); - return ((freeBlocks * blockSize) / 1024) / 1024; - } - - public static long getTotalSize(String path) { - StatFs sf = new StatFs(path); - long blockSize = sf.getBlockSize(); - long allBlocks = sf.getBlockCount(); - return ((allBlocks * blockSize) / 1024) / 1024; - } - - public static String getStoragePath(Context context, boolean isUsb) { - Method VolumeInfo_GetDisk = null; - Method VolumeInfo_GetPath = null; - Method DiskInfo_IsUsb = null; - Method DiskInfo_IsSd = null; - List List_VolumeInfo = null; - String path = ""; - StorageManager mStorageManager = (StorageManager) context.getSystemService("storage"); - try { - Class volumeInfoClazz = Class.forName("android.os.storage.VolumeInfo"); - Class diskInfoClaszz = Class.forName("android.os.storage.DiskInfo"); - Method StorageManager_getVolumes = Class.forName("android.os.storage.StorageManager").getMethod("getVolumes", new Class[0]); - VolumeInfo_GetDisk = volumeInfoClazz.getMethod("getDisk", new Class[0]); - VolumeInfo_GetPath = volumeInfoClazz.getMethod("getPath", new Class[0]); - DiskInfo_IsUsb = diskInfoClaszz.getMethod("isUsb", new Class[0]); - DiskInfo_IsSd = diskInfoClaszz.getMethod("isSd", new Class[0]); - List_VolumeInfo = (List) StorageManager_getVolumes.invoke(mStorageManager, new Object[0]); - } catch (Exception e) { - DSLog.e(TAG, "Exception:" + e.getMessage() + "]"); - e.printStackTrace(); - } - try - { - if ($assertionsDisabled || List_VolumeInfo != null) { - for (int i = 0; i < List_VolumeInfo.size(); i++) { - Object volumeInfo = List_VolumeInfo.get(i); - Object diskInfo = VolumeInfo_GetDisk.invoke(volumeInfo, new Object[0]); - if (diskInfo != null) { - boolean sd = ((Boolean) DiskInfo_IsSd.invoke(diskInfo, new Object[0])).booleanValue(); - boolean usb = ((Boolean) DiskInfo_IsUsb.invoke(diskInfo, new Object[0])).booleanValue(); - File file = (File) VolumeInfo_GetPath.invoke(volumeInfo, new Object[0]); - if (isUsb == usb) { - if (!$assertionsDisabled && file == null) { - throw new AssertionError(); - } - path = file.getAbsolutePath(); - } else if ((!isUsb) != sd) { - continue; - } else if (!$assertionsDisabled && file == null) { - throw new AssertionError(); - } else { - path = file.getAbsolutePath(); - } - } - } - return path; - } - } - catch (Exception ex) - { - } - - throw new AssertionError(); - } -} diff --git a/app/src/main/java/com/dowse/base/util/TimeUtil.java b/app/src/main/java/com/dowse/base/util/TimeUtil.java deleted file mode 100644 index 5f18dc0b..00000000 --- a/app/src/main/java/com/dowse/base/util/TimeUtil.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.dowse.base.util; - -import java.text.SimpleDateFormat; -import java.util.Date; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/TimeUtil.class */ -public class TimeUtil { - public static String getCurrentTime() { - SimpleDateFormat formatter = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); - Date curDate = new Date(); - String timeStr = formatter.format(curDate); - return timeStr; - } -} diff --git a/app/src/main/java/com/dowse/base/util/WifiUtil.java b/app/src/main/java/com/dowse/base/util/WifiUtil.java deleted file mode 100644 index 81add7c8..00000000 --- a/app/src/main/java/com/dowse/base/util/WifiUtil.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.dowse.base.util; - -import android.content.Context; -import android.net.ConnectivityManager; -import android.net.wifi.WifiConfiguration; -import android.net.wifi.WifiInfo; -import android.net.wifi.WifiManager; -import android.os.ResultReceiver; -import android.text.TextUtils; -import com.dowse.base.log.DSLog; -import java.lang.reflect.Field; -import java.lang.reflect.Method; - -/* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/WifiUtil.class */ -public class WifiUtil { - private static final String TAG = "WifiUtil"; - - /* loaded from: ds_base_2.0.9_23030112.aar:classes.jar:com/dowse/base/util/WifiUtil$CallBack.class */ - public interface CallBack { - void connnectResult(boolean z); - } - - public static void enableAP(Context context, String name, String password) { - DSLog.d(TAG, "Enable Wi-Fi AP,name=" + name + ",password=" + password); - try { - WifiManager wifiManager = (WifiManager) context.getSystemService("wifi"); - ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity"); - WifiConfiguration wifiConfiguration = new WifiConfiguration(); - wifiConfiguration.SSID = name; - wifiConfiguration.allowedKeyManagement.set(4); - wifiConfiguration.allowedAuthAlgorithms.set(0); - wifiConfiguration.preSharedKey = password; - if (wifiManager != null) { - Method setWifiApConfigurationMethod = wifiManager.getClass().getMethod("setWifiApConfiguration", WifiConfiguration.class); - setWifiApConfigurationMethod.invoke(wifiManager, wifiConfiguration); - } - if (connectivityManager != null) { - ResultReceiver dummyResultReceiver = new ResultReceiver(null); - Field internalConnectivityManagerField = ConnectivityManager.class.getDeclaredField("mService"); - internalConnectivityManagerField.setAccessible(true); - Object internalConnectivityManagerObject = internalConnectivityManagerField.get(connectivityManager); - if (internalConnectivityManagerObject != null) { - String className = internalConnectivityManagerObject.getClass().getName(); - Class internalConnectivityManagerClass = Class.forName(className); - Method startTetheringMethod = internalConnectivityManagerClass.getDeclaredMethod("startTethering", Integer.TYPE, ResultReceiver.class, Boolean.TYPE, String.class); - startTetheringMethod.invoke(internalConnectivityManagerObject, 0, dummyResultReceiver, false, context.getPackageName()); - } - } - } catch (Exception e) { - DSLog.e(TAG, "Enable Wi-Fi AP : Exception " + e.getMessage()); - e.printStackTrace(); - } - } - - public static void disableAp(Context context) { - DSLog.d(TAG, "Disable Wi-Fi AP "); - try { - ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity"); - if (connectivityManager != null) { - Field internalConnectivityManagerField = ConnectivityManager.class.getDeclaredField("mService"); - internalConnectivityManagerField.setAccessible(true); - Object internalConnectivityManagerObject = internalConnectivityManagerField.get(connectivityManager); - if (internalConnectivityManagerObject != null) { - String className = internalConnectivityManagerObject.getClass().getName(); - Class internalConnectivityManagerClass = Class.forName(className); - Method stopTethering = internalConnectivityManagerClass.getDeclaredMethod("stopTethering", Integer.TYPE, String.class); - stopTethering.invoke(internalConnectivityManagerObject, 0, context.getPackageName()); - } - } - } catch (Exception e) { - DSLog.e(TAG, "DisableAp: Exception " + e.getMessage()); - e.printStackTrace(); - } - } - - public static WifiConfiguration createWifiInfo(String ssid, String password) { - WifiConfiguration config = new WifiConfiguration(); - config.allowedAuthAlgorithms.clear(); - config.allowedGroupCiphers.clear(); - config.allowedKeyManagement.clear(); - config.allowedPairwiseCiphers.clear(); - config.allowedProtocols.clear(); - config.SSID = "\"" + ssid + "\""; - if (TextUtils.isEmpty(password)) { - config.allowedKeyManagement.set(0); - DSLog.i(TAG, "password is ''"); - return config; - } - config.preSharedKey = "\"" + password + "\""; - config.allowedAuthAlgorithms.set(0); - config.allowedGroupCiphers.set(2); - config.allowedGroupCiphers.set(3); - config.allowedKeyManagement.set(1); - config.allowedPairwiseCiphers.set(1); - config.allowedPairwiseCiphers.set(2); - config.allowedProtocols.set(1); - config.allowedProtocols.set(0); - config.status = 2; - return config; - } - - public static void connectWIFI(Context context, String wifiApName, String password, CallBack callBack) { - if (context == null || callBack == null) { - DSLog.i(TAG, "context == null || callBack == null"); - return; - } - WifiManager mWifiManager = (WifiManager) context.getSystemService("wifi"); - WifiConfiguration wifiNewConfiguration = createWifiInfo(wifiApName, password); - int newNetworkId = mWifiManager.addNetwork(wifiNewConfiguration); - if (newNetworkId == -1) { - DSLog.e(TAG, "操作失败,需要将wifi列表中取消对设备连接的保存"); - callBack.connnectResult(false); - return; - } - DSLog.d(TAG, "newNetworkId is:" + newNetworkId); - if (!mWifiManager.isWifiEnabled()) { - mWifiManager.setWifiEnabled(true); - } - boolean enableNetwork = mWifiManager.enableNetwork(newNetworkId, true); - if (!enableNetwork) { - DSLog.e(TAG, "切换到指定wifi失败"); - callBack.connnectResult(false); - return; - } - DSLog.e(TAG, "切换到指定wifi成功"); - callBack.connnectResult(true); - } - - public static void disconnectWIFI(Context context) { - WifiManager mWifiManager = (WifiManager) context.getSystemService("wifi"); - mWifiManager.disconnect(); - mWifiManager.setWifiEnabled(false); - } - - public static boolean isWifiOpen(Context context) { - WifiManager wifiManager = (WifiManager) context.getSystemService("wifi"); - return wifiManager.isWifiEnabled(); - } - - public static WifiInfo getWifInfo(Context context) { - WifiManager wifiManager = (WifiManager) context.getSystemService("wifi"); - if (!wifiManager.isWifiEnabled()) { - return null; - } - WifiInfo wifiInfo = wifiManager.getConnectionInfo(); - return wifiInfo; - } - - public static String intToIp(int paramInt) { - return (paramInt & 255) + "." + (255 & (paramInt >> 8)) + "." + (255 & (paramInt >> 16)) + "." + (255 & (paramInt >> 24)); - } - - public static boolean isWifiApEnabled(Context context) { - WifiManager wifiManager = (WifiManager) context.getSystemService("wifi"); - try { - Method method = wifiManager.getClass().getMethod("isWifiApEnabled", new Class[0]); - method.setAccessible(true); - return ((Boolean) method.invoke(wifiManager, new Object[0])).booleanValue(); - } catch (NoSuchMethodException e) { - e.printStackTrace(); - return false; - } catch (Exception e2) { - e2.printStackTrace(); - return false; - } - } - - public static String getApSSID(Context context) { - Object localObject1; - WifiManager wifiManager = (WifiManager) context.getSystemService("wifi"); - try { - Method localMethod = wifiManager.getClass().getDeclaredMethod("getWifiApConfiguration", new Class[0]); - if (localMethod == null || (localObject1 = localMethod.invoke(wifiManager, new Object[0])) == null) { - return null; - } - WifiConfiguration localWifiConfiguration = (WifiConfiguration) localObject1; - if (localWifiConfiguration.SSID != null) { - return localWifiConfiguration.SSID; - } - Field localField1 = WifiConfiguration.class.getDeclaredField("mWifiApProfile"); - if (localField1 == null) { - return null; - } - localField1.setAccessible(true); - Object localObject2 = localField1.get(localWifiConfiguration); - localField1.setAccessible(false); - if (localObject2 == null) { - return null; - } - Field localField2 = localObject2.getClass().getDeclaredField("SSID"); - localField2.setAccessible(true); - Object localObject3 = localField2.get(localObject2); - if (localObject3 == null) { - return null; - } - localField2.setAccessible(false); - String str = (String) localObject3; - return str; - } catch (Exception e) { - return null; - } - } - - public static int getWifiApState(Context context) { - WifiManager wifiManager = (WifiManager) context.getSystemService("wifi"); - try { - int i = ((Integer) wifiManager.getClass().getMethod("getWifiApState", new Class[0]).invoke(wifiManager, new Object[0])).intValue(); - return i; - } catch (Exception e) { - return 4; - } - } -} diff --git a/app/src/main/java/com/dowse/camera/client/BuildConfig.java b/app/src/main/java/com/dowse/camera/client/BuildConfig.java deleted file mode 100644 index 33d26c81..00000000 --- a/app/src/main/java/com/dowse/camera/client/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dowse.camera.client; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/BuildConfig.class */ -public final class BuildConfig { - public static final boolean DEBUG = Boolean.parseBoolean("true"); - public static final String LIBRARY_PACKAGE_NAME = "com.dowse.camera.client"; - public static final String BUILD_TYPE = "debug"; -} diff --git a/app/src/main/java/com/dowse/camera/client/DSCameraManager.java b/app/src/main/java/com/dowse/camera/client/DSCameraManager.java deleted file mode 100644 index 0b10db6a..00000000 --- a/app/src/main/java/com/dowse/camera/client/DSCameraManager.java +++ /dev/null @@ -1,727 +0,0 @@ -package com.dowse.camera.client; - -import android.content.Context; -import android.text.TextUtils; -// import com.dowse.base.audio.DSAudioFrame; -import com.dowse.base.data.DS4GInfo; -import com.dowse.base.data.DSDeviceCustomInfo; -import com.dowse.base.data.DSLocation; -import com.dowse.base.data.DSTFInfo; -import com.dowse.base.data.DSWIFIAPInfo; -import com.dowse.base.data.DSWIFIInfo; -import com.dowse.base.data.StaticIPInfo; -import com.dowse.base.log.DSLog; -import com.dowse.base.param.NetType; -import com.dowse.base.param.maintenance.MaintenanceParam; -import com.dowse.base.param.pic.ChannelPicParam; -import com.dowse.base.param.video.ChannelOSD; -import com.dowse.base.param.video.ChannelVideoParam; -import com.dowse.base.util.ContextUtil; -import com.dowse.base.util.MD5Util; -import com.dowse.camera.client.data.DSCamera; -import com.dowse.camera.client.data.DSDeviceInfo; -import com.dowse.camera.client.data.DSMP4Video; -import com.dowse.camera.client.data.DSSupportPhotoSize; -import com.dowse.camera.client.data.DSVideoFrame; -import com.dowse.camera.client.jni.DSCameraClientJNI; -import com.dowse.camera.client.listener.DSCameraListener; -import com.dowse.camera.client.listener.IAudioDataListener; -import com.dowse.camera.client.listener.IDSMp4Listener; -import com.dowse.camera.client.listener.IDSVideoStopListener; -import com.dowse.camera.client.listener.IVideoDataListener; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; -import java.util.HashMap; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/DSCameraManager.class */ -public class DSCameraManager implements IDSVideoStopListener { - private static final String TAG = "DSCameraManager"; - private Context mContext; - private DSCameraClientJNI cameraJNI; - private static String mServerIP; - private boolean isInit = false; - private int mHandle = -1; - private int mVideoHandle = -1; - private int mAudioHandle = -1; - private HashMap mDSMp4Maps = null; - private IVideoDataListener mVideoListener = null; - private IAudioDataListener mAudioListener = null; - private DSCameraListener listener = new DSCameraListener() { // from class: com.dowse.camera.client.DSCameraManager.1 - @Override // com.dowse.camera.client.listener.DSCameraListener - public void onDisconnect(int handle) { - // DSLog.e(DSCameraManager.TAG, "DSCameraManager is disconnect!!!"); - DSCameraManager.this.mHandle = -1; - DSCameraManager.this.mVideoHandle = -1; - DSCameraManager.this.mAudioHandle = -1; - if (DSCameraManager.this.mVideoListener != null) { - DSCameraManager.this.mVideoListener.onVideoStop(); - } - if (DSCameraManager.this.mAudioListener != null) { - DSCameraManager.this.mAudioListener.onAudioStop(); - } - } - - @Override // com.dowse.camera.client.listener.DSCameraListener - public void onData(int handle, byte channel, byte stream_no, byte type, byte code, byte is_keyframe, long timeStamp, short width, short heigth, byte[] data) { - if (type == 0) { - DSVideoFrame videoFrame = new DSVideoFrame(channel, stream_no, width, heigth, code, is_keyframe, timeStamp, data); - DSCameraManager.this.onMp4VideoProcess(channel, videoFrame); - DSCameraManager.this.onVideoProcess(handle, videoFrame); - } - if (type == 1) { - // DSAudioFrame audioFrame = new DSAudioFrame(data); - // DSCameraManager.this.onAudioProcess(handle, audioFrame); - } - } - }; - - static { - System.loadLibrary("camera_client"); - mServerIP = "127.0.0.1"; - } - - /* JADX INFO: Access modifiers changed from: private */ - public void onMp4VideoProcess(int channel, DSVideoFrame videoFrame) { - DSMP4Video mp4Video; - if (this.mDSMp4Maps != null && (mp4Video = this.mDSMp4Maps.get(Integer.valueOf(channel))) != null) { - mp4Video.addData(videoFrame); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void onVideoProcess(int handle, DSVideoFrame videoFrame) { - if (this.mVideoHandle >= 0 && this.mHandle == handle && this.mVideoListener != null) { - this.mVideoListener.onVideoData(videoFrame); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - /* - public void onAudioProcess(int handle, DSAudioFrame audioFrame) { - if (this.mAudioHandle >= 0 && this.mHandle == handle && this.mAudioListener != null) { - this.mAudioListener.onAudioData(audioFrame); - } - } - - */ - - public DSCameraManager() { - this.mContext = null; - this.mContext = ContextUtil.getApplication(); - if (this.cameraJNI == null) { - this.cameraJNI = new DSCameraClientJNI(); - } - } - - public static DSCameraManager getInstace() { - return DSCameraManagerHolder.instance; - } - - /* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/DSCameraManager$DSCameraManagerHolder.class */ - private static class DSCameraManagerHolder { - public static final DSCameraManager instance = new DSCameraManager(); - - private DSCameraManagerHolder() { - } - } - - /* JADX WARN: Type inference failed for: r0v0, types: [com.dowse.camera.client.DSCameraManager$2] */ - private void getConnectHandle() { - new Thread() { // from class: com.dowse.camera.client.DSCameraManager.2 - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - if (DSCameraManager.this.mHandle <= 0) { - DSCameraManager.this.mHandle = DSCameraManager.this.cameraJNI.connect(DSCameraManager.mServerIP, DSCameraManager.this.listener); - } - DSLog.e(DSCameraManager.TAG, "DSCameraManager getConnectHandle mHandle=" + DSCameraManager.this.mHandle); - } - }.start(); - } - - private boolean client_check() { - if (!this.isInit) { - DSLog.e(TAG, "DSCameraManager is not call init!!!"); - return false; - } else if (this.mHandle > 0) { - return true; - } else { - getConnectHandle(); - return false; - } - } - - private boolean check() { - if (!this.isInit) { - DSLog.e(TAG, "DSCameraManager is not call init!!!"); - return false; - } - if (this.mHandle < 0) { - DSLog.d(TAG, "DSCameraManager not connect, reconnect"); - this.mHandle = this.cameraJNI.connect(mServerIP, this.listener); - } - if (this.mHandle > 0) { - return true; - } - return false; - } - - public boolean isCameraServiceOK() { - boolean result = client_check(); - DSLog.d(TAG, "DSCameraManager isCameraServiceOK = " + result); - return result; - } - - private boolean writeFile(String path, byte[] bytes) { - try { - FileOutputStream out = new FileOutputStream(path); - FileChannel fileChannel = out.getChannel(); - fileChannel.write(ByteBuffer.wrap(bytes)); - fileChannel.force(true); - fileChannel.close(); - return true; - } catch (FileNotFoundException e) { - e.printStackTrace(); - return false; - } catch (IOException e2) { - e2.printStackTrace(); - return false; - } - } - - public boolean setServerIP(String serverIP) { - mServerIP = serverIP; - return check(); - } - - public boolean init() { - if (!this.isInit) { - String logDir = "/sdcard/apps/log/" + MD5Util.md5(this.mContext.getPackageName()) + File.separator; - File file = new File(logDir); - if (!file.isDirectory() || !file.exists()) { - file.mkdirs(); - } - String debugName = MD5Util.md5(this.mContext.getPackageName()) + "_native.log"; - String errorName = MD5Util.md5(this.mContext.getPackageName()) + "_native_fatal.log"; - DSLog.i(TAG, "Native Log Path=" + logDir); - DSLog.i(TAG, "Native log file path = " + logDir + debugName); - DSLog.i(TAG, "Native fatal log file path = " + logDir + errorName); - this.cameraJNI.init(logDir, debugName, errorName); - this.isInit = true; - return true; - } - return true; - } - - public boolean takePhoto(String path, int channel, String osd_time) { - byte[] image; - if (check() && (image = this.cameraJNI.takePhotoWithOSD(this.mHandle, channel, 0, 0, osd_time + " ")) != null && image.length > 0) { - return writeFile(path, image); - } - return false; - } - - public boolean takePhoto(String path, int channel) { - byte[] image; - if (check() && (image = this.cameraJNI.takePhoto(this.mHandle, channel, 0, 0)) != null && image.length > 0) { - return writeFile(path, image); - } - return false; - } - - public boolean takePhoto(String path, int channel, int width, int height) { - byte[] image; - if (check() && (image = this.cameraJNI.takePhoto(this.mHandle, channel, width, height)) != null && image.length > 0) { - return writeFile(path, image); - } - return false; - } - - public boolean takePhoto(String path, int channel, int width, int height, String osd_time) { - byte[] image; - if (check() && (image = this.cameraJNI.takePhotoWithOSD(this.mHandle, channel, width, height, osd_time + " ")) != null && image.length > 0) { - return writeFile(path, image); - } - return false; - } - - public boolean recordMp4(Context mContext, int channel, int stream_no, String path, int seconds, IDSMp4Listener listener) { - if (check()) { - if (this.mDSMp4Maps == null) { - this.mDSMp4Maps = new HashMap<>(); - } - if (this.mDSMp4Maps.get(Integer.valueOf(channel)) != null) { - DSLog.d(TAG, "channel : " + channel + " is recording mp4"); - return false; - } - DSMP4Video dsmp4Video = new DSMP4Video(mContext, channel, seconds, path, listener, this); - this.mDSMp4Maps.put(Integer.valueOf(channel), dsmp4Video); - int videoHandle = this.cameraJNI.startVideoStreaming(this.mHandle, channel, stream_no); - if (videoHandle < 0) { - this.mDSMp4Maps.remove(Integer.valueOf(channel)); - return false; - } - dsmp4Video.setVideoHandle(videoHandle); - return true; - } - return false; - } - - public boolean startVideo(int channel, int stream_no, IVideoDataListener mVideoListener) { - if (check()) { - if (this.mVideoHandle < 0) { - this.mVideoHandle = this.cameraJNI.startVideoStreaming(this.mHandle, channel, stream_no); - if (this.mVideoHandle < 0) { - DSLog.d(TAG, "video start failed!"); - return false; - } - this.mVideoListener = mVideoListener; - return true; - } - DSLog.d(TAG, "video is streaming ...,please stop first!"); - return false; - } - return false; - } - - public void stopVideo() { - if (check() && this.mVideoHandle >= 0) { - this.cameraJNI.stopVideoStreaming(this.mHandle, this.mVideoHandle); - } - this.mVideoHandle = -1; - this.mVideoListener = null; - } - - public boolean unInit() { - if (this.isInit) { - if (this.mHandle > 0) { - this.cameraJNI.disconnect(this.mHandle); - } - this.cameraJNI.uninit(); - this.isInit = false; - return true; - } - return true; - } - - @Override // com.dowse.camera.client.listener.IDSVideoStopListener - public void onStopVideo(int channel, int videoHandle) { - if (check()) { - this.cameraJNI.stopVideoStreaming(this.mHandle, videoHandle); - } - this.mDSMp4Maps.remove(Integer.valueOf(channel)); - } - - public DSCamera getDSCamera() { - if (check()) { - return this.cameraJNI.getDSCamera(this.mHandle); - } - return null; - } - - public DSSupportPhotoSize getSupportPhotoSize(int channel) { - if (check()) { - return this.cameraJNI.getSupportPhotoSize(this.mHandle, channel); - } - return null; - } - - public DSDeviceInfo getDeviceInfo() { - if (check()) { - return this.cameraJNI.getDeviceInfo(this.mHandle); - } - return null; - } - - public StaticIPInfo getStaticIP() { - if (check()) { - return this.cameraJNI.getStaticIP(this.mHandle); - } - return null; - } - - public boolean setStaticIP(String ip, String mask, String gw, String dns1, String dns2) { - if (check()) { - StaticIPInfo staticIPInfo = new StaticIPInfo(); - staticIPInfo.setIp(ip); - staticIPInfo.setMask(mask); - staticIPInfo.setGw(gw); - staticIPInfo.setDns1(dns1); - staticIPInfo.setDns2(dns2); - return this.cameraJNI.setStaticIP(this.mHandle, staticIPInfo); - } - return false; - } - - public DS4GInfo getDS4GInfo(NetType netType) { - if (check()) { - return this.cameraJNI.get4GInfo(this.mHandle, netType.getNet_type()); - } - return null; - } - - public String getMCUVersion() { - if (check()) { - return this.cameraJNI.getMCUVer(this.mHandle); - } - return null; - } - - public int getSolarVolt() { - if (check()) { - return this.cameraJNI.getSolarVolt(this.mHandle); - } - return -1; - } - - public int getBatVolt() { - if (check()) { - return this.cameraJNI.getBatVolt(this.mHandle); - } - return -1; - } - - public int getBatSoc() { - if (check()) { - return this.cameraJNI.getBatSoc(this.mHandle); - } - return -1; - } - - public int getBatTotal() { - if (check()) { - return this.cameraJNI.getBatTotal(this.mHandle); - } - return -1; - } - - public int getWorkCurrent() { - if (check()) { - return this.cameraJNI.getWorkCurrent(this.mHandle); - } - return -1; - } - - public int getChargeStatus() { - if (check()) { - return this.cameraJNI.getChargeStatus(this.mHandle); - } - return -1; - } - - public String getNRSECVersion() { - if (check()) { - return this.cameraJNI.getNrsecVersion(this.mHandle); - } - return null; - } - - public DSLocation getGPSLocation() { - if (check()) { - return this.cameraJNI.getGPSLocation(this.mHandle); - } - return null; - } - - public boolean setGPSEnable(boolean enable) { - if (check()) { - return this.cameraJNI.setGPSStatus(this.mHandle, enable ? 1 : 0); - } - return false; - } - - public DSTFInfo getTFInfo() { - if (check()) { - return this.cameraJNI.getDSTFInfo(this.mHandle); - } - return null; - } - - public DSWIFIInfo getWiFiInfo() { - if (check()) { - return this.cameraJNI.getWiFiInfo(this.mHandle); - } - return null; - } - - public boolean openWiFi(String ssid, String password) { - if (check()) { - if (TextUtils.isEmpty(ssid) || TextUtils.isEmpty(password)) { - DSLog.e(TAG, "ssid is null or password is null!!!"); - return false; - } else if (password.length() < 8) { - DSLog.e(TAG, "password len is less than 8!!!"); - return false; - } else { - DSWIFIInfo wifiInfo = new DSWIFIInfo(); - wifiInfo.setSsid(ssid); - wifiInfo.setPassword(password); - wifiInfo.setEnable(1); - return this.cameraJNI.setWiFiInfo(this.mHandle, wifiInfo); - } - } - return false; - } - - public boolean closeWiFi() { - DSWIFIInfo wifiInfo; - if (check() && (wifiInfo = getWiFiInfo()) != null) { - wifiInfo.setEnable(0); - return this.cameraJNI.setWiFiInfo(this.mHandle, wifiInfo); - } - return false; - } - - public DSWIFIAPInfo getWiFiAPInfo() { - if (check()) { - return this.cameraJNI.getWiFiAPInfo(this.mHandle); - } - return null; - } - - public boolean openWiFiAP(String ssid, String password) { - if (check()) { - if (TextUtils.isEmpty(ssid) || TextUtils.isEmpty(password)) { - DSLog.e(TAG, "ssid is null or password is null!!!"); - return false; - } else if (password.length() < 8) { - DSLog.e(TAG, "password len is less than 8!!!"); - return false; - } else { - DSWIFIAPInfo dswifiapInfo = new DSWIFIAPInfo(); - dswifiapInfo.setSsid(ssid); - dswifiapInfo.setPassword(password); - dswifiapInfo.setEnable(1); - return this.cameraJNI.setWiFiAPInfo(this.mHandle, dswifiapInfo); - } - } - return false; - } - - public boolean closeWiFiAP() { - DSWIFIAPInfo wiFiAPInfo; - if (check() && (wiFiAPInfo = getWiFiAPInfo()) != null) { - wiFiAPInfo.setEnable(0); - return this.cameraJNI.setWiFiAPInfo(this.mHandle, wiFiAPInfo); - } - return false; - } - - public boolean startCapture() { - boolean result = false; - if (check()) { - result = this.cameraJNI.startAudioCapture(this.mHandle); - } - return result; - } - - public boolean stopCapture() { - boolean result = false; - if (check()) { - result = this.cameraJNI.stopAudioCapture(this.mHandle); - } - return result; - } - - public boolean startAudio(IAudioDataListener listener) { - if (this.mAudioHandle < 0) { - this.mAudioHandle = this.cameraJNI.startAudio(this.mHandle, 0); - if (this.mAudioHandle < 0) { - DSLog.d(TAG, "audio start failed!"); - return false; - } - this.mAudioListener = listener; - return true; - } - DSLog.d(TAG, "audio is streaming ...,please stop first!"); - return false; - } - - public void stopAudio() { - if (check() && this.mAudioHandle >= 0) { - this.cameraJNI.stopAudio(this.mHandle, this.mAudioHandle); - } - this.mAudioHandle = -1; - this.mAudioListener = null; - } - - public boolean startAudioPlayer() { - boolean result = false; - if (check()) { - result = this.cameraJNI.startAudioPlayer(this.mHandle); - } - return result; - } - - public boolean stopAudioPlayer() { - boolean result = false; - if (check()) { - result = this.cameraJNI.stopAudioPlayer(this.mHandle); - } - return result; - } - - public boolean playAudio(byte[] g711) { - boolean result = false; - if (check()) { - result = this.cameraJNI.playAudio(this.mHandle, g711); - } - return result; - } - - public int getChargeCurrent() { - if (check()) { - return this.cameraJNI.getChargeCurrent(this.mHandle); - } - return -1; - } - - public int getHiVolt() { - if (check()) { - return this.cameraJNI.getHiVolt(this.mHandle); - } - return -1; - } - - public int getLowVolt() { - if (check()) { - return this.cameraJNI.getLowVolt(this.mHandle); - } - return -1; - } - - public int getBoardTemp() { - if (check()) { - return this.cameraJNI.getBoardTemp(this.mHandle); - } - return -1; - } - - public int getBatTemp() { - if (check()) { - return this.cameraJNI.getBatTemp(this.mHandle); - } - return -1; - } - - public MaintenanceParam getMaintenanceParam() { - if (check()) { - return this.cameraJNI.getConnectPCParam(this.mHandle); - } - return null; - } - - public boolean setConnectPCParam(int enable, NetType netType, String ip, int port) { - if (check()) { - int sim = NetType.getSim(netType); - if (this.mContext != null) { - String ethName = NetType.getBindEthName(this.mContext, sim); - return this.cameraJNI.setConnectPCParam(this.mHandle, enable, sim, ethName, ip, port); - } - DSLog.e(TAG, "setConnectPCParam failed,mContext is null!!!"); - return false; - } - return false; - } - - public DSDeviceCustomInfo getDeviceCustomInfo() { - if (check()) { - return this.cameraJNI.getDeviceCustomInfo(this.mHandle); - } - return null; - } - - public boolean setDeviceCustomInfo(DSDeviceCustomInfo info) { - if (check()) { - return this.cameraJNI.setDeviceCustomInfo(this.mHandle, info); - } - return false; - } - - public ChannelPicParam getPicParam(int channel) { - if (check()) { - return this.cameraJNI.getPicParam(this.mHandle, channel); - } - return null; - } - - public boolean setPicParam(int channel, ChannelPicParam param) { - if (check()) { - return this.cameraJNI.setPicParam(this.mHandle, channel, param); - } - return false; - } - - public ChannelVideoParam getVideoParam(int channel) { - if (check()) { - return this.cameraJNI.getVideoParam(this.mHandle, channel); - } - return null; - } - - public boolean setVideoParam(int channel, ChannelVideoParam param) { - if (check()) { - return this.cameraJNI.setVideoParam(this.mHandle, channel, param); - } - return false; - } - - public ChannelOSD getOSDParam(int channel) { - if (check()) { - return this.cameraJNI.getOSDParam(this.mHandle, channel); - } - return null; - } - - public boolean setOSDParam(int channel, ChannelOSD param) { - if (check()) { - return this.cameraJNI.setOSDParam(this.mHandle, channel, param); - } - return false; - } - - public String getI1ParamJson(String i1_key) { - if (check()) { - return this.cameraJNI.getI1ParamJson(this.mHandle, i1_key); - } - return ""; - } - - public boolean setI1ParamJson(String i1_key, String i1_param_json) { - if (check()) { - return this.cameraJNI.setI1ParamJson(this.mHandle, 0, i1_key, i1_param_json); - } - return false; - } - - public String getAIRegCode() { - if (check()) { - return this.cameraJNI.getAIRegCode(this.mHandle); - } - return ""; - } - - public boolean setAICDKey(String key) { - if (check()) { - return this.cameraJNI.setAICDKey(this.mHandle, key); - } - return false; - } - - public boolean callI1Fun(int funID, int channel, int media_type) { - if (check()) { - return this.cameraJNI.runI1Fun(this.mHandle, funID, channel, media_type); - } - return false; - } - - public String callRemote(String key, String param, String callFrom) { - if (check()) { - return this.cameraJNI.callFromRemote(this.mHandle, key, param, callFrom); - } - return null; - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/DSCamera.java b/app/src/main/java/com/dowse/camera/client/data/DSCamera.java deleted file mode 100644 index 4ca8c481..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/DSCamera.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.dowse.camera.client.data; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/DSCamera.class */ -public class DSCamera { - private int number; - private DSChannel[] channels; - - public int getNumber() { - return this.number; - } - - public void setNumber(int number) { - this.number = number; - } - - public DSChannel[] getChannels() { - return this.channels; - } - - public void setChannels(DSChannel[] channels) { - this.channels = channels; - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/DSChannel.java b/app/src/main/java/com/dowse/camera/client/data/DSChannel.java deleted file mode 100644 index 1db25b07..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/DSChannel.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.dowse.camera.client.data; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/DSChannel.class */ -public class DSChannel { - private int channel; - private int facing; - private int index; - private int stream_main; - private int stream_second; - private int stream_third; - - public int getChannel() { - return this.channel; - } - - public void setChannel(int channel) { - this.channel = channel; - } - - public int getFacing() { - return this.facing; - } - - public void setFacing(int facing) { - this.facing = facing; - } - - public int getIndex() { - return this.index; - } - - public void setIndex(int index) { - this.index = index; - } - - public int getStream_main() { - return this.stream_main; - } - - public void setStream_main(int stream_main) { - this.stream_main = stream_main; - } - - public int getStream_second() { - return this.stream_second; - } - - public void setStream_second(int stream_second) { - this.stream_second = stream_second; - } - - public int getStream_third() { - return this.stream_third; - } - - public void setStream_third(int stream_third) { - this.stream_third = stream_third; - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/DSDeviceInfo.java b/app/src/main/java/com/dowse/camera/client/data/DSDeviceInfo.java deleted file mode 100644 index 93bc2c0a..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/DSDeviceInfo.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.dowse.camera.client.data; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/DSDeviceInfo.class */ -public class DSDeviceInfo { - private String model; - private String sn; - private String sysVer; - private String hardVer; - private String mcuVer; - private long runTime; - - public String getModel() { - return this.model; - } - - public void setModel(String model) { - this.model = model; - } - - public String getSysVer() { - return this.sysVer; - } - - public void setSysVer(String sysVer) { - this.sysVer = sysVer; - } - - public String getHardVer() { - return this.hardVer; - } - - public void setHardVer(String hardVer) { - this.hardVer = hardVer; - } - - public String getMcuVer() { - return this.mcuVer; - } - - public void setMcuVer(String mcuVer) { - this.mcuVer = mcuVer; - } - - public long getRunTime() { - return this.runTime; - } - - public void setRunTime(long runTime) { - this.runTime = runTime; - } - - public String getSn() { - return this.sn; - } - - public void setSn(String sn) { - this.sn = sn; - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/DSMP4Video.java b/app/src/main/java/com/dowse/camera/client/data/DSMP4Video.java deleted file mode 100644 index 1735e53e..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/DSMP4Video.java +++ /dev/null @@ -1,149 +0,0 @@ -// -// Source code recreated from a .class file by IntelliJ IDEA -// (powered by FernFlower decompiler) -// - -package com.dowse.camera.client.data; - -import android.content.Context; -import android.os.Handler; -import android.os.HandlerThread; -import android.util.Log; -import com.coremedia.iso.boxes.Container; -import com.dowse.base.log.DSLog; -import com.dowse.camera.client.listener.IDSMp4Listener; -import com.dowse.camera.client.listener.IDSVideoStopListener; -import com.dowse.camera.client.listener.IRecordListener; -import com.dowse.camera.client.video.DSRecordThread; -import com.googlecode.mp4parser.FileDataSourceImpl; -import com.googlecode.mp4parser.authoring.Movie; -import com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder; -import com.googlecode.mp4parser.authoring.tracks.h264.H264TrackImpl; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.channels.FileChannel; - -public class DSMP4Video { - private DSQueue mQueue; - private static final String TAG = "DSMP4Video"; - private IDSVideoStopListener mIDSVideoStopListener; - private IDSMp4Listener listener; - private Context mContext; - private int channel; - private int sencods; - private String path; - private String h264Path; - private int videoHandle = -1; - private DSRecordThread mDSRecordThread; - private static final String H264_PATH = "/sdcard/dowse/mp4_h264"; - private Handler mHandler; - private IRecordListener mIRecordListener = new IRecordListener() { - public void onStart(long timeStamp) { - DSLog.d("DSMP4Video", "start record mp4,start time = " + timeStamp); - } - - public void onStop(long timeStamp) { - DSLog.d("DSMP4Video", "stop record time mp4,end time = " + timeStamp); - DSMP4Video.this.stopWork(); - } - }; - - public DSMP4Video(Context mContext, int channel, int seconds, String path, IDSMp4Listener listener, IDSVideoStopListener mIDSVideoStopListener) { - this.mContext = mContext; - this.channel = channel; - this.sencods = seconds; - this.path = path; - this.listener = listener; - this.mIDSVideoStopListener = mIDSVideoStopListener; - this.mQueue = new DSQueue(); - HandlerThread mHandlerThread = new HandlerThread("DSMP4Video"); - mHandlerThread.start(); - this.mHandler = new Handler(mHandlerThread.getLooper()); - this.initDir(); - } - - private void initDir() { - File file = new File("/sdcard/dowse/mp4_h264"); - if (!file.exists()) { - file.mkdirs(); - } - - } - - public void setVideoHandle(int videoHandle) { - this.videoHandle = videoHandle; - this.doWork(); - } - - public void addData(DSVideoFrame videoFrame) { - this.mQueue.add(videoFrame); - } - - public void doWork() { - this.h264Path = "/sdcard/dowse/mp4_h264" + File.separator + "_" + this.channel + "_" + this.sencods + "_" + System.currentTimeMillis() + "_.h264"; - if (this.mDSRecordThread == null) { - this.mDSRecordThread = new DSRecordThread(this.mQueue, this.h264Path, this.sencods, this.mIRecordListener); - } - - this.mDSRecordThread.start(); - } - - public void stopWork() { - this.mDSRecordThread.stopThread(); - if (this.mIDSVideoStopListener != null) { - this.mIDSVideoStopListener.onStopVideo(this.channel, this.videoHandle); - } - - this.onChangeH264ToMp4(); - } - - private void onChangeH264ToMp4() { - FileOutputStream fos = null; - File h264File = null; - boolean result = false; - - label109: { - try { - Log.d("DSMP4Video", "fileVideoPath:" + this.h264Path); - h264File = new File(this.h264Path); - if (h264File.exists()) { - H264TrackImpl h264Track = new H264TrackImpl(new FileDataSourceImpl(h264File)); - Movie m = new Movie(); - m.addTrack(h264Track); - Container out = (new DefaultMp4Builder()).build(m); - fos = new FileOutputStream(this.path); - FileChannel fc = fos.getChannel(); - out.writeContainer(fc); - result = true; - break label109; - } - - if (this.listener != null) { - this.listener.onResult(this.path, false); - } - } catch (Exception var17) { - var17.printStackTrace(); - result = false; - break label109; - } finally { - try { - if (null != fos) { - fos.close(); - } - } catch (IOException var16) { - var16.printStackTrace(); - } - - } - - return; - } - - h264File.delete(); - if (this.listener != null) { - this.listener.onResult(this.path, result); - } - - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/DSQueue.java b/app/src/main/java/com/dowse/camera/client/data/DSQueue.java deleted file mode 100644 index 603db78e..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/DSQueue.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.dowse.camera.client.data; - -import java.util.LinkedList; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/DSQueue.class */ -public class DSQueue { - private static final Object lockObjectQueue = new Object(); - private LinkedList list = new LinkedList(); - - public void clear() { - synchronized (lockObjectQueue) { - this.list.clear(); - } - } - - public boolean isEmpty() { - return this.list.isEmpty(); - } - - public void add(Object o) { - synchronized (lockObjectQueue) { - this.list.addLast(o); - } - } - - public Object get() { - synchronized (lockObjectQueue) { - if (!this.list.isEmpty()) { - return this.list.removeFirst(); - } - return null; - } - } - - public int length() { - int size; - synchronized (lockObjectQueue) { - size = this.list.size(); - } - return size; - } - - public Object peek() { - return this.list.getFirst(); - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/DSSupportPhotoSize.java b/app/src/main/java/com/dowse/camera/client/data/DSSupportPhotoSize.java deleted file mode 100644 index e59dbb8f..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/DSSupportPhotoSize.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.dowse.camera.client.data; - -import java.util.Arrays; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/DSSupportPhotoSize.class */ -public class DSSupportPhotoSize { - int len; - PhotoSize[] sizes; - - public int getLen() { - return this.len; - } - - public void setLen(int len) { - this.len = len; - } - - public PhotoSize[] getSizes() { - return this.sizes; - } - - public void setSizes(PhotoSize[] sizes) { - this.sizes = sizes; - } - - public String toString() { - return "DSSupportPhotoSize{len=" + this.len + ", sizes=" + Arrays.toString(this.sizes) + '}'; - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/DSVideoFrame.java b/app/src/main/java/com/dowse/camera/client/data/DSVideoFrame.java deleted file mode 100644 index f051997a..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/DSVideoFrame.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.dowse.camera.client.data; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/DSVideoFrame.class */ -public class DSVideoFrame { - private long timeStamp; - private short channel; - private short stream_no; - private short width; - private short heigth; - private short code; - private byte is_keyframe; - private short frame_num; - private byte[] data; - - public DSVideoFrame(short channel, short stream_no, short width, short heigth, short code, byte is_keyframe, long timeStamp, byte[] data) { - this.channel = channel; - this.stream_no = stream_no; - this.width = width; - this.heigth = heigth; - this.code = code; - this.is_keyframe = is_keyframe; - this.data = data; - this.timeStamp = timeStamp; - } - - public long getTimeStamp() { - return this.timeStamp; - } - - public void setTimeStamp(long timeStamp) { - this.timeStamp = timeStamp; - } - - public short getChannel() { - return this.channel; - } - - public void setChannel(short channel) { - this.channel = channel; - } - - public short getStream_no() { - return this.stream_no; - } - - public void setStream_no(short stream_no) { - this.stream_no = stream_no; - } - - public short getWidth() { - return this.width; - } - - public void setWidth(short width) { - this.width = width; - } - - public short getHeigth() { - return this.heigth; - } - - public void setHeigth(short heigth) { - this.heigth = heigth; - } - - public short getCode() { - return this.code; - } - - public void setCode(short code) { - this.code = code; - } - - public byte getIs_keyframe() { - return this.is_keyframe; - } - - public void setIs_keyframe(byte is_keyframe) { - this.is_keyframe = is_keyframe; - } - - public short getFrame_num() { - return this.frame_num; - } - - public void setFrame_num(short frame_num) { - this.frame_num = frame_num; - } - - public byte[] getData() { - return this.data; - } - - public void setData(byte[] data) { - this.data = data; - } -} diff --git a/app/src/main/java/com/dowse/camera/client/data/PhotoSize.java b/app/src/main/java/com/dowse/camera/client/data/PhotoSize.java deleted file mode 100644 index cb83e0c0..00000000 --- a/app/src/main/java/com/dowse/camera/client/data/PhotoSize.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.dowse.camera.client.data; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/PhotoSize.class */ -public class PhotoSize { - private int index; - private int width; - private int height; - - public int getIndex() { - return this.index; - } - - public void setIndex(int index) { - this.index = index; - } - - public int getWidth() { - return this.width; - } - - public void setWidth(int width) { - this.width = width; - } - - public int getHeight() { - return this.height; - } - - public void setHeight(int height) { - this.height = height; - } - - public String toString() { - return "PhotoSize{index=" + this.index + ", width=" + this.width + ", height=" + this.height + '}'; - } -} diff --git a/app/src/main/java/com/dowse/camera/client/jni/DSCameraClientJNI.java b/app/src/main/java/com/dowse/camera/client/jni/DSCameraClientJNI.java deleted file mode 100644 index aa2f1018..00000000 --- a/app/src/main/java/com/dowse/camera/client/jni/DSCameraClientJNI.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.dowse.camera.client.jni; - -import com.dowse.base.data.DS4GInfo; -import com.dowse.base.data.DSDeviceCustomInfo; -import com.dowse.base.data.DSLocation; -import com.dowse.base.data.DSTFInfo; -import com.dowse.base.data.DSWIFIAPInfo; -import com.dowse.base.data.DSWIFIInfo; -import com.dowse.base.data.StaticIPInfo; -import com.dowse.base.param.maintenance.MaintenanceParam; -import com.dowse.base.param.pic.ChannelPicParam; -import com.dowse.base.param.video.ChannelOSD; -import com.dowse.base.param.video.ChannelVideoParam; -import com.dowse.camera.client.data.DSCamera; -import com.dowse.camera.client.data.DSDeviceInfo; -import com.dowse.camera.client.data.DSSupportPhotoSize; -import com.dowse.camera.client.listener.DSCameraListener; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/jni/DSCameraClientJNI.class */ -public class DSCameraClientJNI { - public native void init(String str, String str2, String str3); - - public native int connect(String str, DSCameraListener dSCameraListener); - - public native void disconnect(int i); - - public native void uninit(); - - public native DSCamera getDSCamera(int i); - - public native DSSupportPhotoSize getSupportPhotoSize(int i, int i2); - - public native int startVideoStreaming(int i, int i2, int i3); - - public native boolean stopVideoStreaming(int i, int i2); - - public native byte[] takePhoto(int i, int i2, int i3, int i4); - - public native byte[] takePhotoWithOSD(int i, int i2, int i3, int i4, String str); - - public native DS4GInfo get4GInfo(int i, int i2); - - public native DSDeviceInfo getDeviceInfo(int i); - - public native StaticIPInfo getStaticIP(int i); - - public native boolean setStaticIP(int i, StaticIPInfo staticIPInfo); - - public native String getMCUVer(int i); - - public native int getSolarVolt(int i); - - public native int getBatVolt(int i); - - public native int getBatSoc(int i); - - public native int getBatTotal(int i); - - public native int getChargeCurrent(int i); - - public native int getHiVolt(int i); - - public native int getLowVolt(int i); - - public native int getBoardTemp(int i); - - public native int getBatTemp(int i); - - public native int getWorkCurrent(int i); - - public native int getChargeStatus(int i); - - public native String getNrsecVersion(int i); - - public native DSLocation getGPSLocation(int i); - - public native boolean setGPSStatus(int i, int i2); - - public native DSTFInfo getDSTFInfo(int i); - - public native DSWIFIInfo getWiFiInfo(int i); - - public native boolean setWiFiInfo(int i, DSWIFIInfo dSWIFIInfo); - - public native DSWIFIAPInfo getWiFiAPInfo(int i); - - public native boolean setWiFiAPInfo(int i, DSWIFIAPInfo dSWIFIAPInfo); - - public native boolean setOSDParam(int i, int i2, ChannelOSD channelOSD); - - public native ChannelOSD getOSDParam(int i, int i2); - - public native boolean setPicParam(int i, int i2, ChannelPicParam channelPicParam); - - public native ChannelPicParam getPicParam(int i, int i2); - - public native boolean setVideoParam(int i, int i2, ChannelVideoParam channelVideoParam); - - public native ChannelVideoParam getVideoParam(int i, int i2); - - public native boolean startAudioCapture(int i); - - public native boolean stopAudioCapture(int i); - - public native int startAudio(int i, int i2); - - public native boolean stopAudio(int i, int i2); - - public native boolean startAudioPlayer(int i); - - public native boolean stopAudioPlayer(int i); - - public native boolean playAudio(int i, byte[] bArr); - - public native MaintenanceParam getConnectPCParam(int i); - - public native boolean setConnectPCParam(int i, int i2, int i3, String str, String str2, int i4); - - public native DSDeviceCustomInfo getDeviceCustomInfo(int i); - - public native boolean setDeviceCustomInfo(int i, DSDeviceCustomInfo dSDeviceCustomInfo); - - public native String getI1ParamJson(int i, String str); - - public native boolean setI1ParamJson(int i, int i2, String str, String str2); - - public native String getAIRegCode(int i); - - public native boolean setAICDKey(int i, String str); - - public native boolean runI1Fun(int i, int i2, int i3, int i4); - - public native String callFromRemote(int i, String str, String str2, String str3); -} diff --git a/app/src/main/java/com/dowse/camera/client/listener/DSCameraListener.java b/app/src/main/java/com/dowse/camera/client/listener/DSCameraListener.java deleted file mode 100644 index 257fbfb3..00000000 --- a/app/src/main/java/com/dowse/camera/client/listener/DSCameraListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dowse.camera.client.listener; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/listener/DSCameraListener.class */ -public interface DSCameraListener { - void onDisconnect(int i); - - void onData(int i, byte b, byte b2, byte b3, byte b4, byte b5, long j, short s, short s2, byte[] bArr); -} diff --git a/app/src/main/java/com/dowse/camera/client/listener/IAudioDataListener.java b/app/src/main/java/com/dowse/camera/client/listener/IAudioDataListener.java deleted file mode 100644 index 1ef7512e..00000000 --- a/app/src/main/java/com/dowse/camera/client/listener/IAudioDataListener.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dowse.camera.client.listener; - -import com.dowse.base.audio.DSAudioFrame; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/listener/IAudioDataListener.class */ -public interface IAudioDataListener { - void onAudioData(DSAudioFrame dSAudioFrame); - - void onAudioStop(); -} diff --git a/app/src/main/java/com/dowse/camera/client/listener/IDSMp4Listener.java b/app/src/main/java/com/dowse/camera/client/listener/IDSMp4Listener.java deleted file mode 100644 index 4d6401de..00000000 --- a/app/src/main/java/com/dowse/camera/client/listener/IDSMp4Listener.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.dowse.camera.client.listener; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/listener/IDSMp4Listener.class */ -public interface IDSMp4Listener { - void onResult(String str, boolean z); -} diff --git a/app/src/main/java/com/dowse/camera/client/listener/IDSVideoStopListener.java b/app/src/main/java/com/dowse/camera/client/listener/IDSVideoStopListener.java deleted file mode 100644 index a15166dd..00000000 --- a/app/src/main/java/com/dowse/camera/client/listener/IDSVideoStopListener.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.dowse.camera.client.listener; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/listener/IDSVideoStopListener.class */ -public interface IDSVideoStopListener { - void onStopVideo(int i, int i2); -} diff --git a/app/src/main/java/com/dowse/camera/client/listener/IRecordListener.java b/app/src/main/java/com/dowse/camera/client/listener/IRecordListener.java deleted file mode 100644 index a5560210..00000000 --- a/app/src/main/java/com/dowse/camera/client/listener/IRecordListener.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.dowse.camera.client.listener; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/listener/IRecordListener.class */ -public interface IRecordListener { - void onStart(long j); - - void onStop(long j); -} diff --git a/app/src/main/java/com/dowse/camera/client/listener/IVideoDataListener.java b/app/src/main/java/com/dowse/camera/client/listener/IVideoDataListener.java deleted file mode 100644 index 872670e1..00000000 --- a/app/src/main/java/com/dowse/camera/client/listener/IVideoDataListener.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dowse.camera.client.listener; - -import com.dowse.camera.client.data.DSVideoFrame; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/listener/IVideoDataListener.class */ -public interface IVideoDataListener { - void onVideoData(DSVideoFrame dSVideoFrame); - - void onVideoStop(); -} diff --git a/app/src/main/java/com/dowse/camera/client/video/DSH264FileUtil.java b/app/src/main/java/com/dowse/camera/client/video/DSH264FileUtil.java deleted file mode 100644 index 4fc71901..00000000 --- a/app/src/main/java/com/dowse/camera/client/video/DSH264FileUtil.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.dowse.camera.client.video; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/video/DSH264FileUtil.class */ -public class DSH264FileUtil { - private OutputStream outputStream; - private String h264Path; - - public DSH264FileUtil(String h264Path) { - this.h264Path = ""; - this.h264Path = h264Path; - File h264File = new File(this.h264Path); - try { - this.outputStream = new FileOutputStream(h264File); - } catch (FileNotFoundException e) { - e.printStackTrace(); - } - } - - public void stopWrite() { - if (this.outputStream != null) { - try { - this.outputStream.flush(); - this.outputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - - public void writeData(byte[] data) { - if (this.outputStream != null) { - try { - this.outputStream.write(data, 0, data.length); - } catch (IOException e) { - e.printStackTrace(); - } - } - } -} diff --git a/app/src/main/java/com/dowse/camera/client/video/DSRecordThread.java b/app/src/main/java/com/dowse/camera/client/video/DSRecordThread.java deleted file mode 100644 index 41188a1d..00000000 --- a/app/src/main/java/com/dowse/camera/client/video/DSRecordThread.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.dowse.camera.client.video; - -import com.dowse.camera.client.data.DSQueue; -import com.dowse.camera.client.data.DSVideoFrame; -import com.dowse.camera.client.listener.IRecordListener; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.channels.FileChannel; - -/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/video/DSRecordThread.class */ -public class DSRecordThread extends Thread { - private DSQueue dsQueue; - private boolean isFirstIn; - private int seconds; - private FileOutputStream fos; - private IRecordListener mIRecordListener; - private final String TAG = DSRecordThread.class.getCanonicalName(); - private boolean isStop = false; - private long firstTimeStamp = 0; - - public DSRecordThread(DSQueue dsQueue, String fileName, int seconds, IRecordListener mIRecordListener) { - this.dsQueue = null; - this.isFirstIn = false; - this.seconds = 0; - this.mIRecordListener = null; - this.dsQueue = dsQueue; - this.mIRecordListener = mIRecordListener; - this.seconds = seconds; - initRecordFile(fileName); - this.isFirstIn = true; - } - - private void initRecordFile(String fileName) { - try { - this.fos = new FileOutputStream(new File(fileName)); - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - Object object; - super.run(); - FileChannel fileChannel = this.fos.getChannel(); - while (!this.isStop) { - if (this.dsQueue != null && (object = this.dsQueue.get()) != null && fileChannel != null) { - try { - DSVideoFrame frame = (DSVideoFrame) object; - frame.getData(); - if (this.isFirstIn && frame.getIs_keyframe() == 1) { - this.isFirstIn = false; - fileChannel.write(ByteBuffer.wrap(frame.getData())); - fileChannel.force(true); - this.firstTimeStamp = frame.getTimeStamp(); - if (this.mIRecordListener != null) { - this.mIRecordListener.onStart(frame.getTimeStamp()); - } - } - if (!this.isFirstIn) { - if (frame.getTimeStamp() - this.firstTimeStamp > this.seconds - 1) { - this.isStop = true; - if (this.mIRecordListener != null) { - this.mIRecordListener.onStop(frame.getTimeStamp()); - } - return; - } - fileChannel.write(ByteBuffer.wrap(frame.getData())); - fileChannel.force(true); - } - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e2) { - e2.printStackTrace(); - } - } - } - } - - public void stopThread() { - try { - this.isStop = true; - this.dsQueue.clear(); - this.fos.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/app/src/main/java/com/xypower/mpapp/MainActivity.java b/app/src/main/java/com/xypower/mpapp/MainActivity.java index 12b1f125..9460b2d4 100644 --- a/app/src/main/java/com/xypower/mpapp/MainActivity.java +++ b/app/src/main/java/com/xypower/mpapp/MainActivity.java @@ -35,7 +35,6 @@ import android.view.WindowManager; import android.widget.Toast; import com.dev.devapi.api.SysApi; -import com.dowse.camera.client.DSCameraManager; import com.xypower.common.CameraUtils; import com.xypower.common.MicroPhotoContext; import com.xypower.mpapp.databinding.ActivityMainBinding; @@ -692,23 +691,6 @@ public class MainActivity extends AppCompatActivity { return 0; } - protected void takePhoto() { - File path = Environment.getExternalStorageDirectory(); - File file = new File(path, "photo.jpg"); - boolean res = false; - - res = DSCameraManager.getInstace().init(); - - res = DSCameraManager.getInstace().takePhoto(file.getAbsolutePath(), 2); - - if (!res) { - int aa = 0; - } - - res = DSCameraManager.getInstace().unInit(); - - } - public native boolean takePhoto(int channel, int preset, String path, String fileName);