Commit 2d1ff1d0 by chengfengpiaopiao

Walle打包配置

parent 82c291be
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
} }
...@@ -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" />-->
<!--&lt;!&ndash;<meta-data&ndash;&gt;--> <!--&lt;!&ndash;<meta-data&ndash;&gt;-->
<!--&lt;!&ndash;android:name="UMENG_MESSAGE_SECRET"&ndash;&gt;--> <!--&lt;!&ndash;android:name="UMENG_MESSAGE_SECRET"&ndash;&gt;-->
......
...@@ -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);
} }
......
...@@ -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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment