Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
g4proxy
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
g4proxy
Commits
78081c3c
Commit
78081c3c
authored
Apr 28, 2019
by
liuzhaoce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change deviceId
parent
ab7a202c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
6 deletions
+27
-6
HttpProxyService.java
app/src/main/java/com/virjar/g4proxy/HttpProxyService.java
+2
-1
MainActivity.java
app/src/main/java/com/virjar/g4proxy/MainActivity.java
+1
-1
SchedulerTaskService.java
...java/com/virjar/g4proxy/service/SchedulerTaskService.java
+1
-0
DeviceMessageUtil.java
...main/java/com/virjar/g4proxy/utils/DeviceMessageUtil.java
+23
-4
No files found.
app/src/main/java/com/virjar/g4proxy/HttpProxyService.java
View file @
78081c3c
...
...
@@ -18,6 +18,7 @@ import com.tencent.mm.BuildConfig;
import
com.tencent.mm.R
;
import
com.virjar.g4proxy.client.G4ProxyClient
;
import
com.virjar.g4proxy.client.LittelProxyBootstrap
;
import
com.virjar.g4proxy.utils.DeviceInfoHolder
;
import
org.littleshoot.proxy.Launcher
;
import
org.slf4j.Logger
;
...
...
@@ -106,7 +107,7 @@ public class HttpProxyService extends Service {
startForeground
(
110
,
notification
);
// 开始前台服务
String
clientKey
=
Settings
.
System
.
getString
(
getContentResolver
(),
Settings
.
Secure
.
ANDROID_ID
);
String
clientKey
=
DeviceInfoHolder
.
getCachedImei
(
this
);
Log
.
i
(
"weijia"
,
"start G4Proxy front service"
);
...
...
app/src/main/java/com/virjar/g4proxy/MainActivity.java
View file @
78081c3c
...
...
@@ -84,7 +84,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
textView
.
append
(
deviceMsg
.
toString
());
Request
request
=
HttpClientUtils
.
postRequest
(
"http://taskcenter.beta.qunar.com/phone/report"
,
deviceMsg
);
Request
request
=
HttpClientUtils
.
postRequest
(
"http://taskcenter.beta.qunar.com/
api/
phone/report"
,
deviceMsg
);
HttpClientUtils
.
getClient
().
newCall
(
request
).
enqueue
(
new
Callback
()
{
@Override
...
...
app/src/main/java/com/virjar/g4proxy/service/SchedulerTaskService.java
View file @
78081c3c
...
...
@@ -11,6 +11,7 @@ import android.os.Handler;
import
android.os.IBinder
;
import
android.os.Looper
;
import
android.os.SystemClock
;
import
android.provider.Settings
;
import
android.support.annotation.Nullable
;
import
android.util.Log
;
import
android.widget.Toast
;
...
...
app/src/main/java/com/virjar/g4proxy/utils/DeviceMessageUtil.java
View file @
78081c3c
...
...
@@ -15,6 +15,7 @@ import android.location.LocationListener;
import
android.location.LocationManager
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.support.v4.app.ActivityCompat
;
import
android.support.v4.content.ContextCompat
;
import
android.telephony.TelephonyManager
;
...
...
@@ -88,11 +89,11 @@ public class DeviceMessageUtil {
Map
<
String
,
String
>
latAndLon
=
DeviceMessageUtil
.
getLatAndLon
(
context
);
try
{
devicesMsg
.
put
(
"deviceId"
,
DeviceInfoHolder
.
getCachedImei
(
context
));
devicesMsg
.
put
(
"deviceId"
,
getSerialNumber
()
+
"_"
+
getAndroidID
(
context
));
devicesMsg
.
put
(
"brand"
,
android
.
os
.
Build
.
BRAND
);
devicesMsg
.
put
(
"os"
,
Build
.
VERSION
.
RELEASE
);
devicesMsg
.
put
(
"mac"
,
getNewMac
());
devicesMsg
.
put
(
"ip"
,
getIPAddress
(
context
));
devicesMsg
.
put
(
"ip"
,
getIPAddress
());
devicesMsg
.
put
(
"cpuUsage"
,
getCPURateDesc
());
devicesMsg
.
put
(
"memoryTotal"
,
getMemoryTotal
());
devicesMsg
.
put
(
"memoryUsage"
,
getMemUsage
(
context
));
...
...
@@ -193,7 +194,7 @@ public class DeviceMessageUtil {
/**
* 通过WiFiManager获取ip地址
*/
private
static
String
getIPAddress
(
Context
context
)
{
private
static
String
getIPAddress
()
{
String
ipV6Ip
=
null
;
String
lookUpIP
=
null
;
try
{
...
...
@@ -371,6 +372,25 @@ public class DeviceMessageUtil {
return
"null"
;
}
/**
* 获取手机序列号
*/
private
static
String
getSerialNumber
()
{
return
android
.
os
.
Build
.
SERIAL
;
}
/**
* 获取手机android_id
*/
private
static
String
getAndroidID
(
Context
context
){
// 另一种获取方式
// DeviceInfoHolder.getCachedAndroidId(context)
return
Settings
.
System
.
getString
(
context
.
getContentResolver
(),
Settings
.
Secure
.
ANDROID_ID
);
}
/**
* 获取app list
*/
...
...
@@ -405,7 +425,6 @@ public class DeviceMessageUtil {
* 获取经纬度provider
*/
private
static
Criteria
getCriteria
()
{
// TODO Auto-generated method stub
Criteria
c
=
new
Criteria
();
c
.
setAccuracy
(
Criteria
.
ACCURACY_COARSE
);
c
.
setSpeedRequired
(
false
);
...
...
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