The getSerial function is not executed by the system application and an error is reported
This commit is contained in:
parent
9b1d2e1e25
commit
c5163fe939
|
@ -11,9 +11,9 @@
|
|||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 2,
|
||||
"versionName": "1.0.02",
|
||||
"outputFile": "JtunRouter_v1.0.02.apk"
|
||||
"versionCode": 3,
|
||||
"versionName": "1.0.03",
|
||||
"outputFile": "JtunRouter_v1.0.03.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:sharedUserId="android.uid.system"
|
||||
>
|
||||
|
||||
<uses-feature
|
||||
|
|
|
@ -62,7 +62,11 @@ object DeviceUtil {
|
|||
fun getDeviceSerial():String{
|
||||
var serial = ""
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
try {
|
||||
//不是系统应用会报错
|
||||
serial = Build.getSerial()
|
||||
}catch (_:Exception){
|
||||
}
|
||||
if(serial.isEmpty()){
|
||||
WifiApControl.getInstance().getImei()?.let {
|
||||
serial = it
|
||||
|
|
Loading…
Reference in New Issue