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
5cd0d967
Commit
5cd0d967
authored
Apr 30, 2019
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade
parent
3d717eeb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
build.gradle
app/build.gradle
+2
-2
MainActivity.java
app/src/main/java/com/virjar/g4proxy/MainActivity.java
+6
-3
HttpClientUtils.java
...c/main/java/com/virjar/g4proxy/utils/HttpClientUtils.java
+3
-3
No files found.
app/build.gradle
View file @
5cd0d967
...
...
@@ -6,8 +6,8 @@ android {
applicationId
"com.tencent.mm"
minSdkVersion
19
targetSdkVersion
26
versionCode
7
versionName
"1.
7
"
versionCode
8
versionName
"1.
8
"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled
true
...
...
app/src/main/java/com/virjar/g4proxy/MainActivity.java
View file @
5cd0d967
...
...
@@ -27,7 +27,7 @@ import okhttp3.Request;
import
okhttp3.Response
;
import
top.wuhaojie.installerlibrary.AutoInstaller
;
public
class
MainActivity
extends
AppCompatActivity
implements
View
.
OnClickListener
{
public
class
MainActivity
extends
AppCompatActivity
implements
View
.
OnClickListener
{
TextView
textView
;
...
...
@@ -74,11 +74,14 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
@Override
public
void
onClick
(
View
v
)
{
if
(
v
.
getId
()
==
R
.
id
.
btn_report
){
if
(
v
.
getId
()
==
R
.
id
.
btn_report
)
{
//待上传的设备信息:devicesMsg
JSONObject
deviceMsg
=
DeviceMessageUtil
.
getDeviceMessage
(
this
);
textView
.
append
(
deviceMsg
.
toString
());
String
clientKey
=
Settings
.
System
.
getString
(
getContentResolver
(),
Settings
.
Secure
.
ANDROID_ID
);
String
text
=
"device: "
+
clientKey
+
"\n\n"
;
textView
.
setText
(
text
+
deviceMsg
);
Request
request
=
HttpClientUtils
.
postRequest
(
"http://taskcenter.beta.qunar.com/api/phone/report"
,
deviceMsg
);
...
...
app/src/main/java/com/virjar/g4proxy/utils/HttpClientUtils.java
View file @
5cd0d967
...
...
@@ -97,9 +97,9 @@ public class HttpClientUtils {
public
static
Request
postRequest
(
String
url
,
org
.
json
.
JSONObject
data
){
Log
.
e
(
"post
m
sg"
,
String
.
valueOf
(
data
));
MediaType
JSON
=
MediaType
.
parse
(
"application/json; charset=utf-8"
);
RequestBody
body
=
RequestBody
.
create
(
JSON
,
String
.
valueOf
(
data
));
Log
.
e
(
"post
M
sg"
,
String
.
valueOf
(
data
));
MediaType
mediaType
=
MediaType
.
parse
(
"application/json; charset=utf-8"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
data
.
toString
(
));
return
new
Request
.
Builder
()
.
url
(
url
)
...
...
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