Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
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
bp
ShenghuoquanBusiness
Commits
7e13a0bd
Commit
7e13a0bd
authored
Jun 17, 2021
by
shiyuelong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 新增动态配置应用名称、服务器地址功能
parent
3c02412f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
67 deletions
+110
-67
AppConfig.kt
...onLib/Common/src/main/java/com/yidian/common/AppConfig.kt
+46
-40
UMConfigUtils.kt
...on/src/main/java/com/yidian/common/utils/UMConfigUtils.kt
+6
-1
build.gradle
app/build.gradle
+31
-13
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+5
-3
YdSubwayApplication.kt
...ain/java/com/shenghuoquan/business/YdSubwayApplication.kt
+3
-2
build.gradle
build.gradle
+3
-3
config.gradle
config/config.gradle
+16
-5
No files found.
CommonLib/Common/src/main/java/com/yidian/common/AppConfig.kt
View file @
7e13a0bd
package
com.yidian.common
class
AppConfig
{
companion
object
{
//生活圈项目
const
val
IS_ENCRYPT
=
false
const
val
KUANGSHI_ALIVE_API_KEY
=
"32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v"
const
val
KUANGSHI_SECRET
=
"usZbQYdI4PQeXhMftsRfHK2msj0DmSIl"
const
val
appid
=
"merchant-b"
const
val
cv
=
"1.0.0"
const
val
version
=
"000100"
const
val
distribution
=
"official"
const
val
platform
=
"1"
//地铁项目
const
val
WeChatAppKey
=
"wxef4c37f254e29e84"
const
val
WeChatAppSecret
=
"fb596ed3641b481b6f973774987fd04f"
const
val
QQAppKey
=
"101923771"
const
val
QQAppSecret
=
"c34d63cfcf9f8b13a71f48424b48d692"
const
val
SinaAppKey
=
"4157874278"
const
val
SinaAppSecret
=
"85c422bc0a1e0553e6a6a075701422a7"
const
val
SinaCallBackUrl
=
"https://api.weibo.com/oauth2/default.html"
const
val
FileProvider
=
"com.shenghuoquan.business.provider"
const
val
privacyPolicyStatement
=
"https://www.appgc.cn/plugins/privacy/content?type=privacy&appId=1080334&ver=210601"
const
val
userProtocol
=
"https://www.appgc.cn/plugins/privacy/content?type=mp&appId=1080334&ver=210601"
const
val
UMAppKey
=
"60c8479fe044530ff0a49936"
//umeng统计key注释
const
val
UMChannel
=
"ANDROID_CHANNEL"
const
val
UMType
=
"metro"
const
val
UMSecret
=
"e78446e86d153e2891ae7523e1532f13"
const
val
PUSH_XIAOMI_SUPPORT_MASK
=
0
x40000000
const
val
PUSH_UMENG_SUPPORT_MASK
=
0
x20000000
const
val
PUSH_GETUI_SUPPORT_MASK
=
0
x10000000
const
val
PUSH_PASS_THROGH_UNIQUE_MASK
=
0
x00000001
const
val
ZIXUN_PUSH_LEVEL
=
PUSH_XIAOMI_SUPPORT_MASK
const
val
PUSH_LEVEL
=
(
PUSH_XIAOMI_SUPPORT_MASK
or
PUSH_UMENG_SUPPORT_MASK
or
PUSH_GETUI_SUPPORT_MASK
or
PUSH_PASS_THROGH_UNIQUE_MASK
)
}
companion
object
{
//生活圈项目
const
val
IS_ENCRYPT
=
false
const
val
KUANGSHI_ALIVE_API_KEY
=
"32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v"
const
val
KUANGSHI_SECRET
=
"usZbQYdI4PQeXhMftsRfHK2msj0DmSIl"
const
val
appid
=
"merchant-b"
const
val
cv
=
"1.0.0"
const
val
version
=
"000100"
const
val
distribution
=
"official"
const
val
platform
=
"1"
//地铁项目
const
val
WeChatAppKey
=
"wxef4c37f254e29e84"
const
val
WeChatAppSecret
=
"fb596ed3641b481b6f973774987fd04f"
const
val
QQAppKey
=
"101923771"
const
val
QQAppSecret
=
"c34d63cfcf9f8b13a71f48424b48d692"
const
val
SinaAppKey
=
"4157874278"
const
val
SinaAppSecret
=
"85c422bc0a1e0553e6a6a075701422a7"
const
val
SinaCallBackUrl
=
"https://api.weibo.com/oauth2/default.html"
const
val
FileProvider
=
"com.shenghuoquan.business.provider"
const
val
privacyPolicyStatement
=
"https://www.appgc.cn/plugins/privacy/content?type=privacy&appId=1080334&ver=210601"
const
val
userProtocol
=
"https://www.appgc.cn/plugins/privacy/content?type=mp&appId=1080334&ver=210601"
// 友盟测试环境配置
const
val
UMAppTestKey
=
"60c8479fe044530ff0a49936"
//umeng统计key注释
const
val
UMTestChannel
=
"ANDROID_CHANNEL"
const
val
UMTestType
=
"metro"
const
val
UMTestSecret
=
"e78446e86d153e2891ae7523e1532f13"
// 友盟线上环境配置
const
val
UMAppKey
=
"60c8479fe044530ff0a49936"
//umeng统计key注释
const
val
UMChannel
=
"ANDROID_CHANNEL"
const
val
UMType
=
"metro"
const
val
UMSecret
=
"e78446e86d153e2891ae7523e1532f13"
const
val
PUSH_XIAOMI_SUPPORT_MASK
=
0
x40000000
const
val
PUSH_UMENG_SUPPORT_MASK
=
0
x20000000
const
val
PUSH_GETUI_SUPPORT_MASK
=
0
x10000000
const
val
PUSH_PASS_THROGH_UNIQUE_MASK
=
0
x00000001
const
val
ZIXUN_PUSH_LEVEL
=
PUSH_XIAOMI_SUPPORT_MASK
const
val
PUSH_LEVEL
=
(
PUSH_XIAOMI_SUPPORT_MASK
or
PUSH_UMENG_SUPPORT_MASK
or
PUSH_GETUI_SUPPORT_MASK
or
PUSH_PASS_THROGH_UNIQUE_MASK
)
}
}
CommonLib/Common/src/main/java/com/yidian/common/utils/UMConfigUtils.kt
View file @
7e13a0bd
...
...
@@ -14,6 +14,7 @@ import com.umeng.message.UmengNotificationClickHandler
import
com.umeng.message.entity.UMessage
import
com.umeng.socialize.PlatformConfig
import
com.yidian.common.AppConfig
import
com.yidian.common.BuildConfig
import
com.yidian.common.HawkConfig
import
com.yidian.common.XRouterPathConstants
import
com.yidian.xpage.XPageManager
...
...
@@ -26,7 +27,11 @@ class UMConfigUtils {
companion
object
{
fun
init
(
context
:
Context
)
{
//release环境上报错误信息,参数有:上下文、APPkey、渠道号、设备类型、推送密钥
UMConfigure
.
init
(
context
,
AppConfig
.
UMAppKey
,
AppConfig
.
UMChannel
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
AppConfig
.
UMSecret
)
if
(
BuildConfig
.
ENV_DEBUG
)
{
UMConfigure
.
init
(
context
,
AppConfig
.
UMAppTestKey
,
AppConfig
.
UMChannel
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
AppConfig
.
UMTestSecret
)
}
else
{
UMConfigure
.
init
(
context
,
AppConfig
.
UMAppKey
,
AppConfig
.
UMChannel
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
AppConfig
.
UMSecret
)
}
//
// // 推送设置
// PlatformConfig.setWeixin(AppConfig.WeChatAppKey, AppConfig.WeChatAppSecret)
...
...
app/build.gradle
View file @
7e13a0bd
...
...
@@ -8,7 +8,7 @@ android {
compileSdkVersion
build_versions
.
compileSdkVersion
defaultConfig
{
applicationId
"com.shenghuoquan.business"
applicationId
rootProject
.
ext
.
android
.
applicationId
minSdkVersion
build_versions
.
minSdkVersion
targetSdkVersion
build_versions
.
targetSdkVersion
versionCode
rootProject
.
ext
.
android
.
versionCode
...
...
@@ -23,15 +23,7 @@ android {
}
}
signingConfigs
{
debug
{
storeFile
file
(
"shenghuoquan-b.jks"
)
keyAlias
'shenghuoquan_key'
keyPassword
'shenghuoquan000'
storePassword
'shenghuoquan000'
v1SigningEnabled
true
v2SigningEnabled
true
}
release
{
production
{
storeFile
file
(
"shenghuoquan-b.jks"
)
keyAlias
'shenghuoquan_key'
keyPassword
'shenghuoquan000'
...
...
@@ -42,17 +34,43 @@ android {
}
buildTypes
{
debug
{
signingConfig
signingConfigs
.
debug
applicationIdSuffix
".debug"
buildConfigField
(
"String"
,
"API_URL"
,
rootProject
.
ext
.
buildParams
.
debug
.
API_URL
)
buildConfigField
(
"String"
,
"PROVIDER_NAME"
,
'\"'
+
rootProject
.
ext
.
android
.
applicationId
+
".debug.fileprovider"
+
'\"'
)
manifestPlaceholders
=
[
app_name
:
"B端测试"
,
file_provider:
rootProject
.
ext
.
android
.
applicationId
+
".debug.fileprovider"
,
]
//不混淆
minifyEnabled
false
//Zipalign优化
zipAlignEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
signingConfig
signingConfigs
.
production
}
release
{
signingConfig
signingConfigs
.
release
buildConfigField
(
"String"
,
"API_URL"
,
rootProject
.
ext
.
buildParams
.
release
.
API_URL
)
buildConfigField
(
"String"
,
"PROVIDER_NAME"
,
'\"'
+
rootProject
.
ext
.
android
.
applicationId
+
".fileprovider"
+
'\"'
)
manifestPlaceholders
=
[
app_name
:
"B端"
,
file_provider:
rootProject
.
ext
.
android
.
applicationId
+
".fileprovider"
,
]
//混淆
minifyEnabled
true
//Zipalign优化
zipAlignEnabled
true
//移除无用的resource文件
shrinkResources
true
signingConfig
signingConfigs
.
production
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
applicationVariants
.
all
{
variant
->
variant
.
outputs
.
all
{
output
->
outputFileName
=
"business-${variant.name}-${defaultConfig.versionName}-${defaultConfig.versionCode}.apk"
}
}
}
}
compileOptions
{
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
...
...
app/src/main/AndroidManifest.xml
View file @
7e13a0bd
...
...
@@ -23,18 +23,19 @@
android:name=
".YdSubwayApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"
@string/app_name
"
android:label=
"
${app_name}
"
android:networkSecurityConfig=
"@xml/network_security_config"
android:requestLegacyExternalStorage=
"true"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
tools:replace=
"android:allowBackup,android:label"
tools:targetApi=
"n"
>
<!-- 以下为友盟分享基本配置信息 start-->
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"
com.shenghuoquan.business.provider
"
android:authorities=
"
${file_provider}
"
android:exported=
"false"
android:grantUriPermissions=
"true"
tools:replace=
"android:authorities"
>
...
...
@@ -76,7 +77,7 @@
android:name=
"com.umeng.socialize.media.WBShareCallBackActivity"
android:configChanges=
"keyboardHidden|orientation"
android:exported=
"false"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
></activity
>
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/
>
<activity
android:name=
"com.sina.weibo.sdk.web.WeiboSdkWebActivity"
android:configChanges=
"keyboardHidden|orientation"
...
...
@@ -227,6 +228,7 @@
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<!--此处注意下包名💊-->
<provider
android:name=
"com.umeng.message.provider.MessageProvider"
android:authorities=
"com.shenghuoquan.business.umeng.message"
...
...
app/src/main/java/com/shenghuoquan/business/YdSubwayApplication.kt
View file @
7e13a0bd
...
...
@@ -110,7 +110,8 @@ class YdSubwayApplication : YdBaseApplication() {
// header["Content-Type"] = "application/json"
// header["charset"] = "UTF-8"
// ServiceFactory.getInstance().addInterceptor(HttpInterceptor(header))
ServiceFactory
.
getInstance
().
init
(
true
,
URLs
.
BASE_URL
,
10
,
10
)
// ServiceFactory.getInstance().init(true, URLs.BASE_URL, 10, 10)
ServiceFactory
.
getInstance
().
init
(
true
,
BuildConfig
.
API_URL
,
10
,
10
)
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSaveCookiesInterceptor
())
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSetCookiesInterceptor
())
...
...
@@ -173,4 +174,4 @@ class YdSubwayApplication : YdBaseApplication() {
Zap
.
addService
(
XPageService
.
name
,
XPageService
())
Zap
.
addService
(
XEventService
.
name
,
XEventService
())
}
}
\ No newline at end of file
}
build.gradle
View file @
7e13a0bd
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
apply
from:
"https://git.yidian-inc.com:8021/arc-android/config/raw/master/version.gradle"
apply
from:
"config/config.gradle"
apply
from:
"config/config.gradle"
addRepos
(
repositories
)
ext
.
kotlin_version
=
build_versions
.
kotlin_version
ext
.
kotlin_version
=
build_versions
.
kotlin_version
repositories
{
google
()
jcenter
()
...
...
@@ -27,7 +27,7 @@ allprojects {
google
()
jcenter
()
mavenCentral
()
maven
{
url
"https://jitpack.io"
}
maven
{
url
"https://
www.
jitpack.io"
}
maven
{
url
'https://repo1.maven.org/maven2/'
}
maven
{
url
"https://dl.bintray.com/thelasterstar/maven/"
}
maven
{
url
"http://dailybuild2.yidian-inc.com:8088/repository/maven-public/"
}
...
...
config/config.gradle
View file @
7e13a0bd
ext
.
android
=
[
versionCode
:
1
,
versionName
:
"1.0"
,
isApplication:
false
]
ext
{
android
=
[
applicationId
:
"com.shenghuoquan.business"
,
versionCode
:
100
,
versionName
:
"1.0.0"
,
isApplication
:
false
]
buildParams
=
[
debug
:
[
API_URL:
'"http://bp-dev.go2yd.com"'
,
],
release:
[
API_URL:
'"http://bp-dev.go2yd.com"'
,
]
]
}
ext
.
dependencies
=
[
publicImplementation
:[
...
...
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