From: xiewei <892331662@qq.com> Date: Sat, 12 Oct 2024 02:23:29 +0000 (+0800) Subject: 241012:新增在线ota功能 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=95f05326483f1f2960ad77a18f8cea477699295e;p=mirrors%2Fhs-sdk.git 241012:新增在线ota功能 --- diff --git a/app/release/hs_debugtool_1.3_release_2024100519.apk b/app/release/hs_debugtool_1.3_release_2024101012.apk similarity index 99% rename from app/release/hs_debugtool_1.3_release_2024100519.apk rename to app/release/hs_debugtool_1.3_release_2024101012.apk index 3788c45..abbaf61 100644 Binary files a/app/release/hs_debugtool_1.3_release_2024100519.apk and b/app/release/hs_debugtool_1.3_release_2024101012.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 3a78b81..22fb6b3 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -13,7 +13,7 @@ "attributes": [], "versionCode": 3, "versionName": "1.3", - "outputFile": "hs_debugtool_1.3_release_2024100519.apk" + "outputFile": "hs_debugtool_1.3_release_2024101012.apk" } ], "elementType": "File" diff --git a/app/src/main/java/com/zhixun/blesdk/debug_tool/OtaActivity.java b/app/src/main/java/com/zhixun/blesdk/debug_tool/OtaActivity.java index 30dd385..8db030c 100644 --- a/app/src/main/java/com/zhixun/blesdk/debug_tool/OtaActivity.java +++ b/app/src/main/java/com/zhixun/blesdk/debug_tool/OtaActivity.java @@ -15,6 +15,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.google.gson.Gson; import com.zhixun.blesdk.debug_tool.adapter.MsgAdapter; import com.zhixun.blesdk.debug_tool.utils.FileHelper; import com.zhixun.blesdk.debug_tool.utils.FuncationChosePopupWindow; @@ -28,6 +29,7 @@ import com.zhixun.blesdk.hssdk.entity.HsDeviceInfo; import com.zhixun.blesdk.hssdk.entity.MsgBody; import com.zhixun.blesdk.hssdk.entity.MsgResponse; import com.zhixun.blesdk.hssdk.entity.OTAInfo; +import com.zhixun.blesdk.hssdk.util.SobLog; import org.json.JSONException; import org.json.JSONObject; @@ -46,7 +48,7 @@ public class OtaActivity extends AppCompatActivity { private ArrayList msg; private Button btn_ota_chose; private Button btn_getLog; - private Button btn_check_ota; + private Button btn_check_ota;//28 11 61 01 d @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -85,10 +87,13 @@ public class OtaActivity extends AppCompatActivity { @Override public void onResponse(MsgResponse msgResponse) { HsDeviceInfo deviceInfo = (HsDeviceInfo) msgResponse.getBody(); + SobLog.d(TAG,"deviceInfo="+new Gson().toJson(deviceInfo)); String version = deviceInfo.getMajor()+"."+deviceInfo.getMid()+"."+deviceInfo.getMinor(); //RL "http://iot.api.thisiot.com/ota/task?deviceId=%s&sourceVersion=%s"//获取升级url - String url = "http://iot.api.thisiot.com/ota/task?deviceId="+deviceInfo.getMacAddress().replace(":","")+"&sourceVersion="+version; + String mac = HsAgentSdk.getInstance().getAPI().getWearDevice().getAddress(); + String url = "http://iot.api.thisiot.com/ota/task/v2?deviceId="+mac.replace(":","")+"&sourceVersion="+version; // url = "http://iot.api.thisiot.com/ota/task/v2?deviceId=28110687C456&sourceVersion=1.1.38";//临时测试url + SobLog.d(TAG,"url="+url); HttpUtil.CallHttp(url, new HttpUtil.HttpCallBack() { @Override public void onResponse(String datas) {