File was renamed from HDLSDK/hdl-common/src/main/java/com/hdl/sdk/common/config/AuthenticateConfig.java |
| | |
| | | package com.hdl.sdk.common.config; |
| | | package com.hdl.sdk.connect.config; |
| | | |
| | | import android.text.TextUtils; |
| | | |
| | | import com.hdl.sdk.common.config.TopicConstant; |
| | | import com.hdl.sdk.common.utils.SPUtils; |
| | | |
| | | |
| | | /** |
| | | * Created by jlchen on 11/11/21. |
| | | * |
| | | * @Description : AuthenticateConfig |
| | | * @Description : HDLLinkConfig |
| | | */ |
| | | public class AuthenticateConfig { |
| | | public class HDLLinkConfig { |
| | | private static final String Authenticate_LS_KEY = "auth_ls_key"; |
| | | private static final String AUTHENTICATE_GATEWAYID_KEY = "auth_gatewayid_key"; |
| | | private static final String AUTHENTICATE_IPADDRESS_KEY = "auth_ipaddress_key"; |
| | |
| | | /** |
| | | * instance |
| | | */ |
| | | private volatile static AuthenticateConfig instance; |
| | | private volatile static HDLLinkConfig instance; |
| | | /** |
| | | * getInstance |
| | | * |
| | | * @return AuthenticateConfig |
| | | */ |
| | | public static synchronized AuthenticateConfig getInstance() { |
| | | public static synchronized HDLLinkConfig getInstance() { |
| | | if (instance == null) { |
| | | synchronized (AuthenticateConfig.class) { |
| | | synchronized (HDLLinkConfig.class) { |
| | | if (instance == null) { |
| | | instance = new AuthenticateConfig(); |
| | | instance = new HDLLinkConfig(); |
| | | instance.loadConfig(); |
| | | } |
| | | } |
| | |
| | | */ |
| | | void loadConfig(){ |
| | | localSecret = SPUtils.getString(Authenticate_LS_KEY, ""); |
| | | gatewayId = SPUtils.getString(AUTHENTICATE_GATEWAYID_KEY, ""); |
| | | ipAddress = SPUtils.getString(AUTHENTICATE_IPADDRESS_KEY, ""); |
| | | } |
| | | |
| | | /** |