龙岗云视频 v2.7版本的 MD5 值为:9298cfa7a85a45936abaf845b6f6bd5c

以下内容为反编译后的 EZOpenSDK.java 源代码,内容仅作参考


package com.videogo.openapi;

import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.text.TextUtils;
import com.ezviz.stream.EZStreamClientManager;
import com.hikvision.dxopensdk.constants.DX_HttpConstants;
import com.hikvision.wifi.configuration.DeviceDiscoveryListener;
import com.videogo.constant.Config;
import com.videogo.main.AppManager;
import com.videogo.openapi.EZConstants;
import com.videogo.openapi.EZOpenSDKListener;
import com.videogo.openapi.bean.EZAccessToken;
import com.videogo.openapi.bean.EZAlarmInfo;
import com.videogo.openapi.bean.EZCloudRecordFile;
import com.videogo.openapi.bean.EZDeviceInfo;
import com.videogo.openapi.bean.EZDeviceRecordFile;
import com.videogo.openapi.bean.EZDeviceUpgradeStatus;
import com.videogo.openapi.bean.EZDeviceVersion;
import com.videogo.openapi.bean.EZLeaveMessage;
import com.videogo.openapi.bean.EZProbeDeviceInfo;
import com.videogo.openapi.bean.EZProbeDeviceInfoResult;
import com.videogo.openapi.bean.EZStorageStatus;
import com.videogo.openapi.bean.EZUserInfo;
import com.videogo.util.LocalInfo;
import com.videogo.util.LogUtil;
import com.videogo.util.Utils;
import com.videogo.wificonfig.APWifiConfig;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class EZOpenSDK {
    public static String API_URL = "https://open.ys7.com";
    private static final String TAG = "EZOpenSDK";
    public static String WEB_URL = "https://openauth.ys7.com";
    private static String _mAPIURL = null;
    private static String _mAppKey = null;
    private static String _mWEBURL = null;
    private static EZOpenSDK mEZOpenSDK = null;
    private static boolean urlStub = false;
    private Application mApplication;
    private EzvizAPI mEzvizAPI;

    private EZOpenSDK(Application application, String str) {
        this.mApplication = null;
        this.mEzvizAPI = null;
        LogUtil.infoLog(TAG, "construct EZOpenSDK, version:" + getVersion());
        this.mEzvizAPI = EzvizAPI.getInstance();
        AppManager.getInstance().getEZSDKConfigurationSyn();
        this.mApplication = application;
    }

    public static void enableP2P(boolean z) {
        Config.ENABLE_P2P = z;
    }

    public static void finiLib() {
        LogUtil.infoLog(TAG, "FiniLib EZOpenSDK, version:" + getVersion());
        AppManager.getInstance().finiLibs();
        EzvizAPI.getInstance().releaseSDK();
    }

    private String getHTTPPublicParam(String str) {
        if (TextUtils.equals(str, DX_HttpConstants.DX_REQ_KEY_CLIENT_TYPE)) {
            return "13";
        }
        if (TextUtils.equals(str, "featureCode")) {
            return LocalInfo.getInstance().getHardwareCode();
        }
        if (TextUtils.equals(str, "osVersion")) {
            return Build.VERSION.RELEASE;
        }
        if (TextUtils.equals(str, "netType")) {
            return EzvizAPI.getInstance().getNetType();
        }
        if (TextUtils.equals(str, "sdkVersion")) {
            return Config.VERSION;
        }
        if (TextUtils.equals(str, DX_HttpConstants.DX_REQ_KEY_APPKEY)) {
            return EzvizAPI.getInstance().getAppKey();
        }
        if (TextUtils.equals(str, "appID")) {
            return LocalInfo.getInstance().getPackageName();
        }
        if (TextUtils.equals(str, "appName")) {
            return LocalInfo.getInstance().getAppName();
        }
        return null;
    }

    private Map<String, String> getHTTPPublicParam() {
        HashMap hashMap = new HashMap();
        hashMap.put(DX_HttpConstants.DX_REQ_KEY_CLIENT_TYPE, "13");
        hashMap.put("featureCode", LocalInfo.getInstance().getHardwareCode());
        hashMap.put("osVersion", Build.VERSION.RELEASE);
        hashMap.put("netType", EzvizAPI.getInstance().getNetType());
        hashMap.put("sdkVersion", Config.VERSION);
        hashMap.put(DX_HttpConstants.DX_REQ_KEY_APPKEY, EzvizAPI.getInstance().getAppKey());
        hashMap.put("appID", LocalInfo.getInstance().getPackageName());
        hashMap.put("appName", LocalInfo.getInstance().getAppName());
        return hashMap;
    }

    public static EZOpenSDK getInstance() {
        return mEZOpenSDK;
    }

    private static void getVariants() {
        if (urlStub && Config.ENABLE_STUB) {
            HashMap hashMap = new HashMap();
            Utils.parseTestConfigFile("/sdcard/videogo_test_cfg", hashMap);
            _mAppKey = (String) hashMap.get("APP_KEY");
            _mAPIURL = (String) hashMap.get("API_URL");
            _mWEBURL = (String) hashMap.get("WEB_URL");
        }
    }

    public static String getVersion() {
        return Config.VERSION;
    }

    public static boolean initLib(Application application, String str) {
        if (TextUtils.isEmpty(str)) {
            LogUtil.errorLog(TAG, "initLib EZOpenSDK, appKey is null");
            return false;
        }
        LocalInfo.init(application);
        LocalInfo.getInstance().setServAddr(API_URL);
        LocalInfo.getInstance().setAuthServAddr(WEB_URL);
        EzvizAPI.init(application, str);
        EzvizAPI.getInstance().setServerUrl(API_URL, WEB_URL);
        EzvizAPI.getInstance().setAccessToken(LocalInfo.getInstance().getEZAccesstoken().getAccessToken());
        EzvizAPI.platformType = EZConstants.EZPlatformType.EZPlatformTypeOPENSDK;
        if (mEZOpenSDK == null) {
            mEZOpenSDK = new EZOpenSDK(application, str);
        }
        showSDKLog(Config.LOGGING);
        return true;
    }

    public static boolean initLib(Application application, String str, String str2) {
        return initLib(application, str);
    }

    public static void showSDKLog(boolean z) {
        Application application;
        Config.LOGGING = z;
        com.ezviz.sdk.configwifi.Config.LOGGING = true;
        EZOpenSDK eZOpenSDK = mEZOpenSDK;
        if (eZOpenSDK == null || (application = eZOpenSDK.mApplication) == null) {
            return;
        }
        EZStreamClientManager.create(application.getApplicationContext()).setLogPrintEnable(z, false);
    }

    public boolean addDevice(String str, String str2) {
        return this.mEzvizAPI.addDeviceBySerialNonTransfer(str, str2);
    }

    public String captureCamera(String str, int i) {
        return this.mEzvizAPI.capturePicture(str, i);
    }

    public void clearStreamInfoCache() {
        this.mEzvizAPI.clearStreamInfoCache();
    }

    public boolean controlPTZ(String str, int i, EZConstants.EZPTZCommand eZPTZCommand, EZConstants.EZPTZAction eZPTZAction, int i2) {
        return this.mEzvizAPI.controlPTZ(str, i, eZPTZCommand, eZPTZAction, i2);
    }

    public void controlVideoFlip(String str, int i, EZConstants.EZPTZDisplayCommand eZPTZDisplayCommand) {
        this.mEzvizAPI.controlVideoFlip(str, i, eZPTZDisplayCommand);
    }

    public EZPlayer createPlayer(String str, int i) {
        return this.mEzvizAPI.createPlayer(str, i);
    }

    public EZPlayer createPlayerWithUrl(String str) {
        return this.mEzvizAPI.createPlayerWithUrl(str);
    }

    public EZPlayer createPlayerWithUserId(int i, int i2, int i3) {
        return this.mEzvizAPI.createPlayerWithUserId(i, i2, i3);
    }

    public byte[] decryptData(byte[] bArr, String str) {
        return this.mEzvizAPI.decryptData(bArr, str);
    }

    public boolean deleteAlarm(List<String> list) {
        return this.mEzvizAPI.deleteAlarm(list);
    }

    public boolean deleteDevice(String str) {
        return this.mEzvizAPI.deleteDeviceNonTransfer(str);
    }

    public boolean deleteLeaveMessages(List<String> list) {
        return this.mEzvizAPI.deleteLeaveMessages(list);
    }

    public boolean formatStorage(String str, int i) {
        return this.mEzvizAPI.formatStorage(str, i);
    }

    public List<EZAlarmInfo> getAlarmList(String str, int i, int i2, Calendar calendar, Calendar calendar2) {
        return this.mEzvizAPI.getAlarmList(str, i, i2, calendar, calendar2);
    }

    public EZDeviceInfo getDeviceInfo(String str) {
        return this.mEzvizAPI.getDeviceInfo(str);
    }

    public List<EZDeviceInfo> getDeviceList(int i, int i2) {
        return this.mEzvizAPI.getDeviceList(i, i2);
    }

    public EZDeviceUpgradeStatus getDeviceUpgradeStatus(String str) {
        return this.mEzvizAPI.getDeviceUpgradeStatus(str);
    }

    public EZDeviceVersion getDeviceVersion(String str) {
        return this.mEzvizAPI.getDeviceVersion(str);
    }

    public EZAccessToken getEZAccessToken() {
        return this.mEzvizAPI.getEZAccessToken();
    }

    public void getLeaveMessageData(Handler handler, EZLeaveMessage eZLeaveMessage, EZOpenSDKListener.EZLeaveMessageFlowCallback eZLeaveMessageFlowCallback) {
        this.mEzvizAPI.getLeaveMessageData(handler, eZLeaveMessage, eZLeaveMessageFlowCallback);
    }

    public List<EZLeaveMessage> getLeaveMessageList(String str, int i, int i2, Calendar calendar, Calendar calendar2) {
        return this.mEzvizAPI.getLeaveMessageList(str, i, i2, calendar, calendar2);
    }

    public List<EZDeviceInfo> getSharedDeviceList(int i, int i2) {
        return this.mEzvizAPI.getSharedDeviceList(i, i2);
    }

    public List<EZStorageStatus> getStorageStatus(String str) {
        return this.mEzvizAPI.getStorageStatus(str);
    }

    public String getTerminalId() {
        return this.mEzvizAPI.getTerminalId();
    }

    public List<EZDeviceInfo> getTrustDeviceList(int i, int i2) {
        return this.mEzvizAPI.getTrustDeviceList(i, i2);
    }

    public int getUnreadMessageCount(String str, EZConstants.EZMessageType eZMessageType) {
        return this.mEzvizAPI.getUnreadMessageCount(str, eZMessageType);
    }

    public EZUserInfo getUserInfo() {
        return this.mEzvizAPI.getEZUserInfo();
    }

    public boolean isLogin() {
        return this.mEzvizAPI.isLogin();
    }

    public void logout() {
        this.mEzvizAPI.logout();
    }

    public void openChangePasswordPage() {
        this.mEzvizAPI.openChangePasswordPage();
    }

    public void openCloudPage(String str) {
        this.mEzvizAPI.openCloudPage(str, 1);
    }

    public void openCloudPage(String str, int i) {
        this.mEzvizAPI.openCloudPage(str, i);
    }

    public void openLoginPage() {
        this.mEzvizAPI.gotoLoginPage(false, -1, -1);
    }

    public void openLoginPage(int i) {
        this.mEzvizAPI.gotoLoginPage(false, -1, i);
    }

    public EZProbeDeviceInfo probeDeviceInfo(String str) {
        return this.mEzvizAPI.probeDeviceInfo(str);
    }

    public EZProbeDeviceInfoResult probeDeviceInfo(String str, String str2) {
        return this.mEzvizAPI.probeDeviceInfo(str, str2);
    }

    public void releasePlayer(EZPlayer eZPlayer) {
        this.mEzvizAPI.releasePlayer(eZPlayer);
    }

    public List<EZCloudRecordFile> searchRecordFileFromCloud(String str, int i, Calendar calendar, Calendar calendar2) {
        return this.mEzvizAPI.searchRecordFileFromCloudEx(str, i, calendar, calendar2);
    }

    public List<EZDeviceRecordFile> searchRecordFileFromDevice(String str, int i, Calendar calendar, Calendar calendar2) {
        return this.mEzvizAPI.searchRecordFileFromDevice(str, i, calendar, calendar2);
    }

    public void setAccessToken(String str) {
        this.mEzvizAPI.setAccessToken(str);
    }

    public boolean setAlarmStatus(List<String> list, EZConstants.EZAlarmStatus eZAlarmStatus) {
        return this.mEzvizAPI.setAlarmStatus(list, eZAlarmStatus);
    }

    public boolean setDefence(String str, EZConstants.EZDefenceStatus eZDefenceStatus) {
        return this.mEzvizAPI.setDefence(str, eZDefenceStatus);
    }

    public boolean setDeviceEncryptStatus(String str, String str2, boolean z) {
        return this.mEzvizAPI.setDeviceEncryptStatus(str, str2, z);
    }

    public boolean setDeviceName(String str, String str2) {
        return this.mEzvizAPI.updateDeviceName(str, str2);
    }

    public boolean setLeaveMessageStatus(List<String> list, EZConstants.EZMessageStatus eZMessageStatus) {
        return this.mEzvizAPI.setLeaveMessageStatus(list, eZMessageStatus);
    }

    public boolean setVideoLevel(String str, int i, int i2) {
        return this.mEzvizAPI.setDeviceVideoLevel(str, i, i2);
    }

    public void setVparamForLoginPage(String str) {
        this.mEzvizAPI.setVparamForLoginPage(str);
    }

    public void startAPConfigWifiWithSsid(String str, String str2, String str3, String str4, APWifiConfig.APConfigCallback aPConfigCallback) {
        this.mEzvizAPI.startAPConfigWifiWithSsid(str, str2, str3, str4, aPConfigCallback);
    }

    public void startAPConfigWifiWithSsid(String str, String str2, String str3, String str4, String str5, String str6, boolean z, APWifiConfig.APConfigCallback aPConfigCallback) {
        this.mEzvizAPI.startAPConfigWifiWithSsid(str, str2, str3, str4, str5, str6, z, aPConfigCallback);
    }

    public void startConfigWifi(Context context, String str, String str2, String str3, int i, EZOpenSDKListener.EZStartConfigWifiCallback eZStartConfigWifiCallback) {
        this.mEzvizAPI.startConfigWifi(context, str, str2, str3, i, eZStartConfigWifiCallback);
    }

    public void startConfigWifi(Context context, String str, String str2, String str3, EZOpenSDKListener.EZStartConfigWifiCallback eZStartConfigWifiCallback) {
        startConfigWifi(context, str, str2, str3, EZConstants.EZWiFiConfigMode.EZWiFiConfigSmart, eZStartConfigWifiCallback);
    }

    public boolean startConfigWifi(Context context, String str, String str2, DeviceDiscoveryListener deviceDiscoveryListener) {
        return this.mEzvizAPI.startConfigWifi(context, str, str2, deviceDiscoveryListener);
    }

    public void stopAPConfigWifiWithSsid() {
        this.mEzvizAPI.stopAPConfigWifiWithSsid();
    }

    public boolean stopConfigWiFi() {
        return this.mEzvizAPI.stopConfigWiFi();
    }

    public void upgradeDevice(String str) {
        this.mEzvizAPI.upgradeDevice(str);
    }
}