Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
feb46a34
Commit
feb46a34
authored
Nov 15, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script
parent
09316943
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
17 deletions
+15
-17
src/main/java/com/common/base/BaseApplication.java
+2
-1
src/main/java/com/common/bean/DeviceInfoBean.java
+2
-2
src/main/java/com/common/utils/Collector.java
+6
-9
src/main/java/tech/starwin/utils/context_utils/DeviceUtils.java
+5
-5
No files found.
src/main/java/com/common/base/BaseApplication.java
View file @
feb46a34
...
...
@@ -35,6 +35,7 @@ import tech.starwin.network.Gateway;
import
tech.starwin.utils.InstallReferrerHelper
;
import
tech.starwin.utils.TrackEventHelper
;
import
tech.starwin.utils.context_utils.AppLanguageUtils
;
import
tech.starwin.utils.context_utils.DeviceUtils
;
import
tech.starwin.utils.format_utils.StringDecrypt
;
/**
...
...
@@ -44,7 +45,7 @@ public abstract class BaseApplication extends MultiDexApplication {
@Override
protected
void
attachBaseContext
(
Context
base
)
{
Device
Info
.
initDefaultLanguage
(
Locale
.
getDefault
()
);
Device
Utils
.
getInstance
().
init
(
base
);
initLibCnofig
();
initToolBox
();
// Context languageContext = AppLanguageUtils.attachBaseContext(base, LibConfig.LANGUAGE);
...
...
src/main/java/com/common/bean/DeviceInfoBean.java
View file @
feb46a34
...
...
@@ -39,7 +39,7 @@ public class DeviceInfoBean implements Serializable {
private
String
brand
=
Build
.
BRAND
;
//品牌
private
String
host
=
Build
.
HOST
;
private
String
host
=
Build
.
HOST
;
// 主机地址
private
String
id
=
Build
.
ID
;
...
...
@@ -47,7 +47,7 @@ public class DeviceInfoBean implements Serializable {
private
String
modelNo
=
Build
.
MODEL
;
//型号
private
String
product
=
Build
.
PRODUCT
;
private
String
product
=
Build
.
PRODUCT
;
//商品信息
private
String
cpuAbi
=
Build
.
CPU_ABI
;
//cpu架构
...
...
src/main/java/com/common/utils/Collector.java
View file @
feb46a34
...
...
@@ -12,6 +12,8 @@ import com.annimon.stream.function.BiFunction;
import
com.annimon.stream.function.Function
;
import
com.common.bean.CollectInfoEntity
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonParser
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
...
...
@@ -156,11 +158,6 @@ public class Collector {
// infos1.add(location);
// }
CollectInfoEntity
deviceInfoEntity
=
new
CollectInfoEntity
();
deviceInfoEntity
.
setType
(
"DEVICE_INFO"
);
deviceInfoEntity
.
setUpdate_time
(
System
.
currentTimeMillis
());
deviceInfoEntity
.
setBody
(
new
Gson
().
toJson
(
DeviceUtils
.
getInstance
().
getDeviceInfo
()));
infos1
.
add
(
deviceInfoEntity
);
return
infos1
;
}
...
...
@@ -211,16 +208,16 @@ public class Collector {
}
private
static
String
toDeviceTypeDTO
(
Context
context
)
{
JSONObject
json
=
initJSON
(
InfoType
.
MACHINE_TYPE
,
context
);
JSONObject
json
=
initJSON
(
InfoType
.
DEVICE_INFO
,
context
);
try
{
JSONArray
array
=
new
JSONArray
();
json
.
put
(
"totalNumber"
,
1
);
json
.
put
(
"latestTime"
,
0
);
json
.
put
(
"earliestTime"
,
0
);
json
.
put
(
"data"
,
new
Gson
().
toJson
(
DeviceUtils
.
getInstance
().
getDeviceInfo
()));
String
deviceInfo
=
new
Gson
().
toJson
(
DeviceUtils
.
getInstance
().
getDeviceInfo
());
JSONObject
jsonObject
=
new
JSONObject
(
deviceInfo
);
json
.
put
(
"data"
,
jsonObject
);
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
...
...
src/main/java/tech/starwin/utils/context_utils/DeviceUtils.java
View file @
feb46a34
...
...
@@ -57,14 +57,14 @@ public class DeviceUtils {
deviceInfoBean
.
setTimeZone
(
TimeZone
.
getDefault
());
long
[]
ramInfo
=
getRAMInfo
(
context
);
deviceInfoBean
.
setTotalMemory
(
ramInfo
[
0
]
/
1024
);
deviceInfoBean
.
setFreeMemory
(
ramInfo
[
1
]
/
1024
);
deviceInfoBean
.
setTotalMemory
(
ramInfo
[
0
]);
deviceInfoBean
.
setFreeMemory
(
ramInfo
[
1
]);
long
[]
romInfo
=
getROMInfo
();
deviceInfoBean
.
setDiskSpace
(
romInfo
[
0
]
/
1024
);
deviceInfoBean
.
setDiskFreeSpace
(
romInfo
[
1
]
/
1024
);
deviceInfoBean
.
setDiskSpace
(
romInfo
[
0
]);
deviceInfoBean
.
setDiskFreeSpace
(
romInfo
[
1
]);
deviceInfoBean
.
setAppSign
(
BuildConfig
.
KEYSTOR_SIGN
);
deviceInfoBean
.
setAppSign
(
BuildConfig
.
KEYSTOR
E
_SIGN
);
deviceInfoBean
.
setBaseBandVersion
(
getBaseBandVersion
());
deviceInfoBean
.
setBattery
(
getBattery
(
context
));
deviceInfoBean
.
setBluetooth
(
Settings
.
Secure
.
getString
(
context
.
getContentResolver
(),
"bluetooth_address"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment