Commit 0260e7db authored by chenyuling's avatar chenyuling

"如果没有获取到sn,默认为ZC2301HSWT"

parent b490d94c
Pipeline #1864 canceled with stages
...@@ -20,7 +20,7 @@ android { ...@@ -20,7 +20,7 @@ android {
minSdk 24 minSdk 24
targetSdk 32 targetSdk 32
versionCode 1 versionCode 1
versionName "1.0.3" versionName "1.0.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
......
...@@ -5,5 +5,5 @@ import com.srthinker.statinfo.util.common.FileUtil; ...@@ -5,5 +5,5 @@ import com.srthinker.statinfo.util.common.FileUtil;
public class Const { public class Const {
public static final String DEVICE_TYPE = "RC500"; public static final String DEVICE_TYPE = "RC500";
public static final String SN_PATH = "/sdcard/devicesn/deviceSn.txt"; public static final String SN_PATH = "/sdcard/devicesn/deviceSn.txt";
public static final String DEVICE_SN = FileUtil.readTextFromFile(SN_PATH); public static String DEVICE_SN = FileUtil.readTextFromFile(SN_PATH);
} }
...@@ -2,11 +2,13 @@ package com.srthinker.statinfo.uis.news; ...@@ -2,11 +2,13 @@ package com.srthinker.statinfo.uis.news;
import static com.srthinker.statinfo.constant.Const.DEVICE_SN; import static com.srthinker.statinfo.constant.Const.DEVICE_SN;
import static com.srthinker.statinfo.constant.Const.DEVICE_TYPE; import static com.srthinker.statinfo.constant.Const.DEVICE_TYPE;
import static com.srthinker.statinfo.constant.Const.SN_PATH;
import static com.srthinker.statinfo.constant.InOutType.ENTER_TYPE; import static com.srthinker.statinfo.constant.InOutType.ENTER_TYPE;
import static com.srthinker.statinfo.constant.InOutType.LEAVE_TYPE; import static com.srthinker.statinfo.constant.InOutType.LEAVE_TYPE;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.srthinker.statinfo.database.PersonMgr; import com.srthinker.statinfo.database.PersonMgr;
...@@ -21,6 +23,7 @@ import com.srthinker.statinfo.uis.BaseActivity; ...@@ -21,6 +23,7 @@ import com.srthinker.statinfo.uis.BaseActivity;
import com.srthinker.statinfo.uis.GroupActivity; import com.srthinker.statinfo.uis.GroupActivity;
import com.srthinker.statinfo.uis.fragment.ConfigDlgFragment; import com.srthinker.statinfo.uis.fragment.ConfigDlgFragment;
import com.srthinker.statinfo.util.common.ClickUtil; import com.srthinker.statinfo.util.common.ClickUtil;
import com.srthinker.statinfo.util.common.FileUtil;
import com.srthinker.statinfo.util.common.SharedUtil; import com.srthinker.statinfo.util.common.SharedUtil;
import com.srthinker.statinfo.util.common.Utils; import com.srthinker.statinfo.util.common.Utils;
import com.srthinker.statinfo.util.other.NetworkIPMonitor; import com.srthinker.statinfo.util.other.NetworkIPMonitor;
...@@ -66,7 +69,10 @@ public class SettingActivity extends BaseActivity implements ConfigCallback, Que ...@@ -66,7 +69,10 @@ public class SettingActivity extends BaseActivity implements ConfigCallback, Que
networkIPMonitor = new NetworkIPMonitor(this); networkIPMonitor = new NetworkIPMonitor(this);
networkIPMonitor.startMonitoring(); networkIPMonitor.startMonitoring();
networkIPMonitor.setOnIPChangeCallback(this); networkIPMonitor.setOnIPChangeCallback(this);
DEVICE_SN = FileUtil.readTextFromFile(SN_PATH);
if (TextUtils.isEmpty(DEVICE_SN)){
DEVICE_SN = "ZC2301HSWT";
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment