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
Show 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
package
com.yidian.common
class
AppConfig
{
class
AppConfig
{
companion
object
{
companion
object
{
//生活圈项目
//生活圈项目
const
val
IS_ENCRYPT
=
false
const
val
IS_ENCRYPT
=
false
const
val
KUANGSHI_ALIVE_API_KEY
=
"32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v"
const
val
KUANGSHI_ALIVE_API_KEY
=
"32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v"
...
@@ -28,6 +28,12 @@ class AppConfig {
...
@@ -28,6 +28,12 @@ class AppConfig {
const
val
privacyPolicyStatement
=
"https://www.appgc.cn/plugins/privacy/content?type=privacy&appId=1080334&ver=210601"
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
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
UMAppKey
=
"60c8479fe044530ff0a49936"
//umeng统计key注释
const
val
UMChannel
=
"ANDROID_CHANNEL"
const
val
UMChannel
=
"ANDROID_CHANNEL"
const
val
UMType
=
"metro"
const
val
UMType
=
"metro"
...
...
CommonLib/Common/src/main/java/com/yidian/common/utils/UMConfigUtils.kt
View file @
7e13a0bd
...
@@ -14,6 +14,7 @@ import com.umeng.message.UmengNotificationClickHandler
...
@@ -14,6 +14,7 @@ import com.umeng.message.UmengNotificationClickHandler
import
com.umeng.message.entity.UMessage
import
com.umeng.message.entity.UMessage
import
com.umeng.socialize.PlatformConfig
import
com.umeng.socialize.PlatformConfig
import
com.yidian.common.AppConfig
import
com.yidian.common.AppConfig
import
com.yidian.common.BuildConfig
import
com.yidian.common.HawkConfig
import
com.yidian.common.HawkConfig
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
...
@@ -26,7 +27,11 @@ class UMConfigUtils {
...
@@ -26,7 +27,11 @@ class UMConfigUtils {
companion
object
{
companion
object
{
fun
init
(
context
:
Context
)
{
fun
init
(
context
:
Context
)
{
//release环境上报错误信息,参数有:上下文、APPkey、渠道号、设备类型、推送密钥
//release环境上报错误信息,参数有:上下文、APPkey、渠道号、设备类型、推送密钥
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
)
UMConfigure
.
init
(
context
,
AppConfig
.
UMAppKey
,
AppConfig
.
UMChannel
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
AppConfig
.
UMSecret
)
}
//
//
// // 推送设置
// // 推送设置
// PlatformConfig.setWeixin(AppConfig.WeChatAppKey, AppConfig.WeChatAppSecret)
// PlatformConfig.setWeixin(AppConfig.WeChatAppKey, AppConfig.WeChatAppSecret)
...
...
app/build.gradle
View file @
7e13a0bd
...
@@ -8,7 +8,7 @@ android {
...
@@ -8,7 +8,7 @@ android {
compileSdkVersion
build_versions
.
compileSdkVersion
compileSdkVersion
build_versions
.
compileSdkVersion
defaultConfig
{
defaultConfig
{
applicationId
"com.shenghuoquan.business"
applicationId
rootProject
.
ext
.
android
.
applicationId
minSdkVersion
build_versions
.
minSdkVersion
minSdkVersion
build_versions
.
minSdkVersion
targetSdkVersion
build_versions
.
targetSdkVersion
targetSdkVersion
build_versions
.
targetSdkVersion
versionCode
rootProject
.
ext
.
android
.
versionCode
versionCode
rootProject
.
ext
.
android
.
versionCode
...
@@ -23,15 +23,7 @@ android {
...
@@ -23,15 +23,7 @@ android {
}
}
}
}
signingConfigs
{
signingConfigs
{
debug
{
production
{
storeFile
file
(
"shenghuoquan-b.jks"
)
keyAlias
'shenghuoquan_key'
keyPassword
'shenghuoquan000'
storePassword
'shenghuoquan000'
v1SigningEnabled
true
v2SigningEnabled
true
}
release
{
storeFile
file
(
"shenghuoquan-b.jks"
)
storeFile
file
(
"shenghuoquan-b.jks"
)
keyAlias
'shenghuoquan_key'
keyAlias
'shenghuoquan_key'
keyPassword
'shenghuoquan000'
keyPassword
'shenghuoquan000'
...
@@ -42,17 +34,43 @@ android {
...
@@ -42,17 +34,43 @@ android {
}
}
buildTypes
{
buildTypes
{
debug
{
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
minifyEnabled
false
//Zipalign优化
zipAlignEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
signingConfig
signingConfigs
.
production
}
}
release
{
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
minifyEnabled
true
//Zipalign优化
zipAlignEnabled
true
//移除无用的resource文件
shrinkResources
true
signingConfig
signingConfigs
.
production
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
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
{
compileOptions
{
sourceCompatibility
JavaVersion
.
VERSION_1_8
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
...
...
app/src/main/AndroidManifest.xml
View file @
7e13a0bd
...
@@ -23,18 +23,19 @@
...
@@ -23,18 +23,19 @@
android:name=
".YdSubwayApplication"
android:name=
".YdSubwayApplication"
android:allowBackup=
"true"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:icon=
"@mipmap/ic_launcher"
android:label=
"
@string/app_name
"
android:label=
"
${app_name}
"
android:networkSecurityConfig=
"@xml/network_security_config"
android:networkSecurityConfig=
"@xml/network_security_config"
android:requestLegacyExternalStorage=
"true"
android:requestLegacyExternalStorage=
"true"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
android:theme=
"@style/AppTheme"
tools:replace=
"android:allowBackup,android:label"
tools:targetApi=
"n"
>
tools:targetApi=
"n"
>
<!-- 以下为友盟分享基本配置信息 start-->
<!-- 以下为友盟分享基本配置信息 start-->
<provider
<provider
android:name=
"androidx.core.content.FileProvider"
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"
com.shenghuoquan.business.provider
"
android:authorities=
"
${file_provider}
"
android:exported=
"false"
android:exported=
"false"
android:grantUriPermissions=
"true"
android:grantUriPermissions=
"true"
tools:replace=
"android:authorities"
>
tools:replace=
"android:authorities"
>
...
@@ -76,7 +77,7 @@
...
@@ -76,7 +77,7 @@
android:name=
"com.umeng.socialize.media.WBShareCallBackActivity"
android:name=
"com.umeng.socialize.media.WBShareCallBackActivity"
android:configChanges=
"keyboardHidden|orientation"
android:configChanges=
"keyboardHidden|orientation"
android:exported=
"false"
android:exported=
"false"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
></activity
>
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/
>
<activity
<activity
android:name=
"com.sina.weibo.sdk.web.WeiboSdkWebActivity"
android:name=
"com.sina.weibo.sdk.web.WeiboSdkWebActivity"
android:configChanges=
"keyboardHidden|orientation"
android:configChanges=
"keyboardHidden|orientation"
...
@@ -227,6 +228,7 @@
...
@@ -227,6 +228,7 @@
android:exported=
"false"
android:exported=
"false"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<!--此处注意下包名💊-->
<provider
<provider
android:name=
"com.umeng.message.provider.MessageProvider"
android:name=
"com.umeng.message.provider.MessageProvider"
android:authorities=
"com.shenghuoquan.business.umeng.message"
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() {
...
@@ -110,7 +110,8 @@ class YdSubwayApplication : YdBaseApplication() {
// header["Content-Type"] = "application/json"
// header["Content-Type"] = "application/json"
// header["charset"] = "UTF-8"
// header["charset"] = "UTF-8"
// ServiceFactory.getInstance().addInterceptor(HttpInterceptor(header))
// 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
(
ApiSaveCookiesInterceptor
())
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSetCookiesInterceptor
())
ServiceFactory
.
getInstance
().
addInterceptor
(
ApiSetCookiesInterceptor
())
...
...
build.gradle
View file @
7e13a0bd
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
buildscript
{
apply
from:
"https://git.yidian-inc.com:8021/arc-android/config/raw/master/version.gradle"
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
)
addRepos
(
repositories
)
ext
.
kotlin_version
=
build_versions
.
kotlin_version
ext
.
kotlin_version
=
build_versions
.
kotlin_version
repositories
{
repositories
{
google
()
google
()
jcenter
()
jcenter
()
...
@@ -27,7 +27,7 @@ allprojects {
...
@@ -27,7 +27,7 @@ allprojects {
google
()
google
()
jcenter
()
jcenter
()
mavenCentral
()
mavenCentral
()
maven
{
url
"https://jitpack.io"
}
maven
{
url
"https://
www.
jitpack.io"
}
maven
{
url
'https://repo1.maven.org/maven2/'
}
maven
{
url
'https://repo1.maven.org/maven2/'
}
maven
{
url
"https://dl.bintray.com/thelasterstar/maven/"
}
maven
{
url
"https://dl.bintray.com/thelasterstar/maven/"
}
maven
{
url
"http://dailybuild2.yidian-inc.com:8088/repository/maven-public/"
}
maven
{
url
"http://dailybuild2.yidian-inc.com:8088/repository/maven-public/"
}
...
...
config/config.gradle
View file @
7e13a0bd
ext
.
android
=
[
ext
{
versionCode
:
1
,
android
=
[
versionName
:
"1.0"
,
applicationId
:
"com.shenghuoquan.business"
,
isApplication:
false
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
=
[
ext
.
dependencies
=
[
publicImplementation
:[
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