Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cash_plugin_toolbox
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
cash_plugin_toolbox
Commits
bb3df803
Commit
bb3df803
authored
Sep 10, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
review mode update
parent
c6c6ba9d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
src/main/java/com/common/toolbox/app_utils/DeviceInfo.java
+26
-8
No files found.
src/main/java/com/common/toolbox/app_utils/DeviceInfo.java
View file @
bb3df803
...
@@ -17,6 +17,7 @@ import java.util.Collections;
...
@@ -17,6 +17,7 @@ import java.util.Collections;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
import
java.util.Locale
;
import
java.util.TimeZone
;
import
java.util.UUID
;
import
java.util.UUID
;
/**
/**
...
@@ -132,17 +133,21 @@ public class DeviceInfo {
...
@@ -132,17 +133,21 @@ public class DeviceInfo {
"tags="
+
Build
.
TAGS
+
"&"
+
"tags="
+
Build
.
TAGS
+
"&"
+
"type="
+
Build
.
TYPE
+
"&"
+
"type="
+
Build
.
TYPE
+
"&"
+
"root="
+
isRoot
()
+
"&"
+
"root="
+
isRoot
()
+
"&"
+
"user="
+
Build
.
USER
+
"&"
;
"user="
+
Build
.
USER
;
if
(
defaultLocale
==
null
)
{
if
(
defaultLocale
==
null
)
{
defaultLocale
=
Locale
.
getDefault
();
defaultLocale
=
Locale
.
getDefault
();
}
}
hardwareInfo
+=
"country="
+
defaultLocale
.
getCountry
()
+
"&"
+
hardwareInfo
+=
"
&
country="
+
defaultLocale
.
getCountry
()
+
"&"
+
"language="
+
defaultLocale
.
getLanguage
()
+
"&"
+
"language="
+
defaultLocale
.
getLanguage
()
+
"&"
+
"display_country="
+
defaultLocale
.
getDisplayCountry
()
+
"&"
+
"display_country="
+
defaultLocale
.
getDisplayCountry
()
+
"&"
+
"display_language="
+
defaultLocale
.
getDisplayLanguage
()
+
"&"
+
"display_language="
+
defaultLocale
.
getDisplayLanguage
()
+
"&"
+
"display_name="
+
defaultLocale
.
getDisplayName
();
"display_name="
+
defaultLocale
.
getDisplayName
();
TimeZone
timeZone
=
TimeZone
.
getDefault
();
hardwareInfo
+=
"&area="
+
timeZone
.
getID
()
+
"&time_zone="
+
timeZone
.
getDisplayName
(
false
,
TimeZone
.
SHORT
);
return
hardwareInfo
;
return
hardwareInfo
;
}
}
...
@@ -182,10 +187,13 @@ public class DeviceInfo {
...
@@ -182,10 +187,13 @@ public class DeviceInfo {
PKG_LIST
=
getPkgsFromeAppList
(
getAppList
(
context
,
100
));
PKG_LIST
=
getPkgsFromeAppList
(
getAppList
(
context
,
100
));
}
}
if
(
defaultLocale
!=
null
)
{
//测试机
return
!(
defaultLocale
.
getCountry
().
equals
(
"CN"
)
||
defaultLocale
.
getCountry
().
equals
(
"ID"
));
TimeZone
timeZone
=
TimeZone
.
getDefault
();
if
(
"samsung"
.
equals
(
Build
.
BRAND
)&&
"Asia/Shanghai"
.
equals
(
timeZone
.
getID
())&&
PKG_LIST
.
contains
(
"com.eg.android.AlipayGphone"
)){
return
false
;
}
}
//如果发现包名黑名单,true
String
[]
blackList
=
getPkgBlackList
();
String
[]
blackList
=
getPkgBlackList
();
for
(
String
pkgName
:
blackList
)
{
for
(
String
pkgName
:
blackList
)
{
if
(
PKG_LIST
.
contains
(
pkgName
))
{
if
(
PKG_LIST
.
contains
(
pkgName
))
{
...
@@ -193,6 +201,17 @@ public class DeviceInfo {
...
@@ -193,6 +201,17 @@ public class DeviceInfo {
}
}
}
}
//时区不是印尼,true
String
timezon
=
timeZone
.
getDisplayName
(
false
,
TimeZone
.
SHORT
).
replaceAll
(
" "
,
""
);
if
(!
TextUtils
.
equals
(
"GMT+07:00"
,
timezon
)
)
{
return
true
;
}
//地区不是印尼 true
if
(
defaultLocale
!=
null
&&
!
defaultLocale
.
getCountry
().
equals
(
"ID"
))
{
return
true
;
}
return
PluginConfig
.
IS_FAKE_MODE
;
return
PluginConfig
.
IS_FAKE_MODE
;
}
}
...
@@ -218,13 +237,12 @@ public class DeviceInfo {
...
@@ -218,13 +237,12 @@ public class DeviceInfo {
public
static
String
getPkgsFromeAppList
(
List
<
PackageInfo
>
appList
)
{
public
static
String
getPkgsFromeAppList
(
List
<
PackageInfo
>
appList
)
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"
&
"
);
builder
.
append
(
"
*
"
);
for
(
PackageInfo
info
:
appList
)
{
for
(
PackageInfo
info
:
appList
)
{
builder
.
append
(
info
.
packageName
);
builder
.
append
(
"&"
);
builder
.
append
(
"&"
);
builder
.
append
(
info
.
packageName
);
}
}
builder
.
deleteCharAt
(
0
);
return
builder
.
toString
().
replace
(
"*&"
,
""
);
return
builder
.
toString
();
}
}
/**
/**
...
...
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