wjc
2025-03-26 68db344081c103c94832b8d0a06be6c6888d66e4
app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -9,6 +9,7 @@
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.net.wifi.ScanResult;
import android.os.IBinder;
import android.os.SystemClock;
import android.provider.Settings;
@@ -729,7 +730,7 @@
                        String json = HdlESLocalJsonLogic.getInstance().readHdlESLocalJson(fileName + ".json", deviceModel);
                        if (TextUtils.isEmpty(json)) {
                            //本地没有缓存
                            HdlESLocalJsonLogic.getInstance().getHdlESLocalJson(fileName, deviceType, deviceModel, new CloudCallBeak<String>() {
                            HdlESLocalJsonLogic.getInstance().getHdlESLocalJson(fileName, deviceType, deviceModel, false, new CloudCallBeak<String>() {
                                @Override
                                public void onSuccess(String obj) {
//                                    if (callback != null) {
@@ -1309,11 +1310,20 @@
        //解密负载数据(写密钥给网关一定是明文,因为那时网关还没有密钥)
        TcpClient.getInstance().sendDataToLinkGateway(mac, false, TopicApi, jsonArray, "", new HDLLinkCallBack() {
            @Override
            public void onSuccess(String msg) {
            public void onSuccess(String s) {
                if (callback != null) {
                    uniSuccessCallback(type, msg, callback);
                    try {
                        if (s.startsWith("{")) {
                            uniSuccessCallback(type, new Gson().fromJson(s, JsonObject.class), callback);
                        } else if (s.startsWith("[")) {
                            uniSuccessCallback(type, new Gson().fromJson(s, JsonArray.class), callback);
                        } else {
                            uniSuccessCallback(type, s, callback);
                        }
                    } catch (Exception e) {
                        uniSuccessCallback(type, s, callback);
                    }
                }
            }
            @Override
@@ -2388,6 +2398,7 @@
     */
    private void uniGetCurrentHomeLocalAndCloudGatewayList(String type, Object data, DCUniMPJSCallback callback) {
        String homeId = getKeyValue("homeId", getKeyValue("data", data));
//        UserConfigManage.getInstance().setHomeId(homeId);
        HdlDeviceLogic.getInstance().getCurrentHomeLocalAndCloudGatewayList(homeId, new CloudCallBeak<List<GatewayBean>>() {
            @Override
            public void onSuccess(List<GatewayBean> list) {
@@ -2893,8 +2904,7 @@
            uniCallBackBaseBean.setData(obj);
            if (callback != null) {
                callback.invoke(getJSONObject(uniCallBackBaseBean));
//                callback.invoke(uniCallBackBaseBean);
                HdlLogLogic.print("回复---uni---" + type + "---" + new Gson().toJson(uniCallBackBaseBean), true);
                HdlLogLogic.print("回复---uni---" + type + "---" + getJSONObject(uniCallBackBaseBean).toString(), true);
            }
        } catch (Exception e) {
            HdlLogLogic.print("回复---uni---" + type + "---" + e.getMessage(), true);