Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
唐文
/
AiyoZhuaWaWa
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2d1ff1d0
authored
Nov 15, 2017
by
chengfengpiaopiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Walle打包配置
parent
82c291be
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
26 deletions
app/build.gradle
app/src/main/AndroidManifest.xml
app/src/main/java/com/maile/jingcai/base/BaseApplication.java
build.gradle
app/build.gradle
View file @
2d1ff1d0
apply
plugin:
'com.android.application'
apply
plugin:
'com.android.application'
apply
plugin:
'walle'
//walle
def
customPropsFile
=
file
(
"buildcustom.properties"
);
def
customPropsFile
=
file
(
"buildcustom.properties"
);
Properties
customProps
=
new
Properties
()
Properties
customProps
=
new
Properties
()
...
@@ -38,17 +39,17 @@ android {
...
@@ -38,17 +39,17 @@ android {
//多渠道配置
//多渠道配置
productFlavors
{
//
productFlavors {
wandoujia
{}
//
wandoujia {}
baidu
{}
//
baidu {}
c360
{}
//
c360 {}
uc
{}
//
uc {}
xiaomi
{}
//
xiaomi {}
huawei
{}
//
huawei {}
productFlavors
.
all
{
flavor
->
//
productFlavors.all { flavor ->
flavor
.
manifestPlaceholders
=
[
UMENG_CHANNEL_VALUE:
name
]
//
flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
}
//
}
}
//
}
buildTypes
{
buildTypes
{
release
{
release
{
...
@@ -68,15 +69,15 @@ android {
...
@@ -68,15 +69,15 @@ android {
}
}
}
}
android
.
applicationVariants
.
all
{
variant
->
//
android.applicationVariants.all { variant ->
variant
.
outputs
.
each
{
output
->
//
variant.outputs.each { output ->
def
outputFile
=
output
.
outputFile
//
def outputFile = output.outputFile
def
channelName
=
variant
.
productFlavors
[
0
].
name
;
//
def channelName = variant.productFlavors[0].name;
//这里修改文件名
//
//这里修改文件名
def
fileName
=
"duobaojingcai_${channelName}_v${defaultConfig.versionName}${suffixName[networkType]}.apk"
//
def fileName = "duobaojingcai_${channelName}_v${defaultConfig.versionName}${suffixName[networkType]}.apk"
output
.
outputFile
=
new
File
(
outputFile
.
parent
,
fileName
)
//
output.outputFile = new File(outputFile.parent, fileName)
}
//
}
}
//
}
}
}
...
@@ -103,4 +104,6 @@ dependencies {
...
@@ -103,4 +104,6 @@ dependencies {
compile
'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
compile
'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar'
compile
'com.umeng.analytics:analytics:latest.integration'
compile
'com.umeng.analytics:analytics:latest.integration'
compile
'com.meituan.android.walle:library:1.1.5'
//walle
}
}
app/src/main/AndroidManifest.xml
View file @
2d1ff1d0
...
@@ -24,9 +24,9 @@
...
@@ -24,9 +24,9 @@
<!--58c25576c895767d61000ec7 -->
<!--58c25576c895767d61000ec7 -->
<
meta-data
<
!--<meta-data-->
android:name=
"UMENG_APPKEY"
<!--android:name="UMENG_APPKEY"-->
android:value=
"5a0abb218f4a9d05b0000036"
/
>
<!--android:value="5a0abb218f4a9d05b0000036" />--
>
<!--<!–<meta-data–>-->
<!--<!–<meta-data–>-->
<!--<!–android:name="UMENG_MESSAGE_SECRET"–>-->
<!--<!–android:name="UMENG_MESSAGE_SECRET"–>-->
...
...
app/src/main/java/com/maile/jingcai/base/BaseApplication.java
View file @
2d1ff1d0
...
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager;
...
@@ -7,6 +7,7 @@ import android.content.pm.PackageManager;
import
android.util.Log
;
import
android.util.Log
;
import
com.maile.jingcai.util.DrawUtil
;
import
com.maile.jingcai.util.DrawUtil
;
import
com.meituan.android.walle.WalleChannelReader
;
import
com.tencent.mm.opensdk.openapi.IWXAPI
;
import
com.tencent.mm.opensdk.openapi.IWXAPI
;
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
;
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
;
import
com.umeng.analytics.MobclickAgent
;
import
com.umeng.analytics.MobclickAgent
;
...
@@ -26,8 +27,10 @@ public class BaseApplication extends Application{
...
@@ -26,8 +27,10 @@ public class BaseApplication extends Application{
DrawUtil
.
resetDensity
(
this
);
DrawUtil
.
resetDensity
(
this
);
regToWx
();
regToWx
();
// 场景类型设置接口,设置为普通统计场景类型
// 场景类型设置接口,设置为普通统计场景类型
// MobclickAgent.setScenarioType(this, MobclickAgent.EScenarioType.E_UM_NORMAL);
String
channel
=
WalleChannelReader
.
getChannel
(
this
.
getApplicationContext
());
// MobclickAgent.startWithConfigure(new MobclickAgent.UMAnalyticsConfig(getApplicationContext(),"5a0abb218f4a9d05b0000036",getChannel(getApplicationContext(),"UMENG_CHANNEL")));
MobclickAgent
.
setScenarioType
(
this
,
MobclickAgent
.
EScenarioType
.
E_UM_NORMAL
);
// MobclickAgent.startWithConfigure(new MobclickAgent.UMAnalyticsConfig(getApplicationContext(),"5a0ac0f58f4a9d05b0000093",getChannel(getApplicationContext(),"UMENG_CHANNEL")));
MobclickAgent
.
startWithConfigure
(
new
MobclickAgent
.
UMAnalyticsConfig
(
getApplicationContext
(),
"5a0c065af43e4850f70000ef"
,
channel
));
// String appkey = "";
// String appkey = "";
// String channal = "";
// String channal = "";
...
@@ -41,6 +44,7 @@ public class BaseApplication extends Application{
...
@@ -41,6 +44,7 @@ public class BaseApplication extends Application{
//
//
Log
.
i
(
"tangwen"
,
"Application: 获取渠道包信息 "
+
getChannel
(
getApplicationContext
(),
"UMENG_CHANNEL"
));
Log
.
i
(
"tangwen"
,
"Application: 获取渠道包信息 "
+
getChannel
(
getApplicationContext
(),
"UMENG_CHANNEL"
));
Log
.
i
(
"tangwen"
,
"Application: 获取渠道包信息 : "
+
channel
);
}
}
...
...
build.gradle
View file @
2d1ff1d0
...
@@ -6,7 +6,7 @@ buildscript {
...
@@ -6,7 +6,7 @@ buildscript {
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools.build:gradle:2.2.3'
classpath
'com.android.tools.build:gradle:2.2.3'
classpath
'com.meituan.android.walle:plugin:1.1.5'
//walle
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
}
}
...
...
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