Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_highgold
Project
Project
Details
Activity
Releases
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
android
android_highgold
Commits
036b7e13
Commit
036b7e13
authored
Apr 15, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加头条母包
parent
6851f0f5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
build.gradle
highgold/app/build.gradle
+6
-4
humesdk-1.0.0.aar
highgold/app/libs/humesdk-1.0.0.aar
+0
-0
OkHttpInterceptor.java
...c/main/java/com/mints/highgold/net/OkHttpInterceptor.java
+22
-1
No files found.
highgold/app/build.gradle
View file @
036b7e13
...
@@ -11,8 +11,8 @@ android {
...
@@ -11,8 +11,8 @@ android {
applicationId
"com.mints.highgold"
applicationId
"com.mints.highgold"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
2
1
versionCode
2
2
versionName
"1.2.
0
"
versionName
"1.2.
1
"
flavorDimensions
"default"
flavorDimensions
"default"
// dex突破65535的限制
// dex突破65535的限制
...
@@ -67,7 +67,8 @@ android {
...
@@ -67,7 +67,8 @@ android {
// 不显示Log
// 不显示Log
buildConfigField
"boolean"
,
"LOG_DEBUG"
,
"true"
buildConfigField
"boolean"
,
"LOG_DEBUG"
,
"true"
buildConfigField
"String"
,
"AppKeyPre"
,
"\"abcd\""
buildConfigField
"String"
,
"AppKeyPre"
,
"\"abcd\""
buildConfigField
"String"
,
"MainIp"
,
DEBUG_URL
// buildConfigField "String", "MainIp", DEBUG_URL
buildConfigField
"String"
,
"MainIp"
,
RELEASE_URL
manifestPlaceholders
=
[
TD_SCHEMA_KEY:
DEBUG_TD_SCHEMA_KEY
,
manifestPlaceholders
=
[
TD_SCHEMA_KEY:
DEBUG_TD_SCHEMA_KEY
,
TD_KEY
:
DEBUG_TD_KEY
]
TD_KEY
:
DEBUG_TD_KEY
]
...
@@ -300,7 +301,8 @@ dependencies {
...
@@ -300,7 +301,8 @@ dependencies {
implementation
(
name:
'wannuosili_ad_1.0.3'
,
ext:
'aar'
)
implementation
(
name:
'wannuosili_ad_1.0.3'
,
ext:
'aar'
)
// implementation project(':lib-todaystepcounter')
// implementation project(':lib-todaystepcounter')
// 应用管理中心分包
implementation
(
name:
'humesdk-1.0.0'
,
ext:
'aar'
)
testImplementation
'junit:junit:4.12'
testImplementation
'junit:junit:4.12'
...
...
highgold/app/libs/humesdk-1.0.0.aar
0 → 100644
View file @
036b7e13
File added
highgold/app/src/main/java/com/mints/highgold/net/OkHttpInterceptor.java
View file @
036b7e13
...
@@ -2,6 +2,7 @@ package com.mints.highgold.net;
...
@@ -2,6 +2,7 @@ package com.mints.highgold.net;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.bytedance.hume.readapk.HumeSDK
;
import
com.google.gson.Gson
;
import
com.google.gson.Gson
;
import
com.mints.highgold.BuildConfig
;
import
com.mints.highgold.BuildConfig
;
import
com.mints.highgold.MintsApplication
;
import
com.mints.highgold.MintsApplication
;
...
@@ -44,7 +45,7 @@ public class OkHttpInterceptor implements Interceptor {
...
@@ -44,7 +45,7 @@ public class OkHttpInterceptor implements Interceptor {
long
time
=
System
.
currentTimeMillis
();
long
time
=
System
.
currentTimeMillis
();
String
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
);
String
channel
=
this
.
createChannel
(
);
Request
request
=
chain
.
request
();
Request
request
=
chain
.
request
();
request
=
encrypt
(
request
,
tokenID
,
time
,
channel
);
//加密方法
request
=
encrypt
(
request
,
tokenID
,
time
,
channel
);
//加密方法
...
@@ -60,6 +61,26 @@ public class OkHttpInterceptor implements Interceptor {
...
@@ -60,6 +61,26 @@ public class OkHttpInterceptor implements Interceptor {
return
chain
.
proceed
(
builder
);
return
chain
.
proceed
(
builder
);
}
}
/**
* 创建渠道
*
* @return
*/
private
String
createChannel
()
{
String
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
);
try
{
// 穿山甲分包渠道
String
ttChannel
=
HumeSDK
.
getChannel
(
MintsApplication
.
getContext
());
if
(!
TextUtils
.
isEmpty
(
ttChannel
))
{
// 此处方式不能修改,已和后端约定
channel
=
channel
+
"_"
+
ttChannel
;
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
channel
;
}
// json加密
// json加密
private
Request
encrypt
(
Request
request
,
String
tokenID
,
long
time
,
String
channel
)
throws
IOException
{
private
Request
encrypt
(
Request
request
,
String
tokenID
,
long
time
,
String
channel
)
throws
IOException
{
//这个是请求的url,也就是咱们前面配置的baseUrl
//这个是请求的url,也就是咱们前面配置的baseUrl
...
...
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