Commit 307416e4 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 876de346
......@@ -39,7 +39,7 @@ android {
UMENG_KEY : RELEASE_UMENG_KEY,
SHARE_KEY : RELEASE_SHARESDK_KEY,
SHARE_SECRET : RELEASE_SHARESDK_SECRET,
"APPLICATION_ID" : applicationId]
APPLICATION_ID : applicationId]
}
......@@ -224,8 +224,8 @@ dependencies {
// 应用管理中心分包
implementation(name: 'humesdk-1.0.0', ext: 'aar')
// umeng
implementation 'com.umeng.umsdk:common:9.1.0' // (必选)
implementation 'com.umeng.umsdk:asms:1.1.3' // asms包依赖(必选)
implementation 'com.umeng.umsdk:common:9.3.8' // (必选)
implementation 'com.umeng.umsdk:asms:1.2.2' // asms包依赖(必选)
implementation 'com.umeng.umsdk:crash:0.0.4' // native crash包依赖(必选)
// TalkingDada(已集成)
// 一览视频
......
......@@ -297,16 +297,15 @@
# ===================== umeng START ================
-keep class com.umeng.** {*;}
-keepclassmembers class * {
public <init> (org.json.JSONObject);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep public class com.mints.goodmoney.R$*{
public static final int *;
}
# ======================= umeng END ================
......
......@@ -111,6 +111,10 @@ public class MintsApplication extends MultiDexApplication {
* 三方配置
*/
private void thirdConfig() {
// 友盟SDK预初始化函数
// preInit预初始化函数耗时极少,不会影响App首次冷启动用户体验
UMConfigure.preInit(this,CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"));
// 初始化toast
initToast();
......@@ -238,7 +242,7 @@ public class MintsApplication extends MultiDexApplication {
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/
UMConfigure.init(context, CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(context, "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "");
UMConfigure.init(MintsApplication.getContext(), CommonUtils.getAppMetaData(MintsApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "");
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL);
} catch (Exception e) {
......
......@@ -16,44 +16,44 @@ import java.net.URLEncoder;
*/
public class PhoneParameterUtils {
// /**
// * 获取MAC地址
// *
// * @return
// */
// public static String getMacAddress(Application application) {
// WifiManager manager = (WifiManager) application.getSystemService(Context.WIFI_SERVICE);
// String MacAddress = "";
// if (manager != null) {
// MacAddress = manager.getConnectionInfo().getMacAddress();
// }
// return MacAddress;
// }
//
// /**
// * 返回用户手机运营商名称 * @param telephonyManager * @return
// */
// public static String getProvidersName(Application loanApplication) {
// String ProvidersName = null;
// try {
// TelephonyManager telephonyManager = (TelephonyManager) loanApplication.getSystemService(Context.TELEPHONY_SERVICE);
// String IMSI; // 返回唯一的用户ID;就是这张卡的编号神马的
// IMSI = telephonyManager.getSubscriberId();
// if (IMSI == null)
// return "unkwon";
// // IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信。其中
// if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {
// ProvidersName = "中国移动";
// } else if (IMSI.startsWith("46001")) {
// ProvidersName = "中国联通";
// } else if (IMSI.startsWith("46003")) {
// ProvidersName = "中国电信";
// }
// ProvidersName = URLEncoder.encode("" + ProvidersName, "UTF-8");
// } catch (UnsupportedEncodingException e) {
// // TODO Auto-generated catch block e.printStackTrace();
// }
// return ProvidersName;
// }
/**
* 获取MAC地址
*
* @return
*/
public static String getMacAddress(Application application) {
WifiManager manager = (WifiManager) application.getSystemService(Context.WIFI_SERVICE);
String MacAddress = "";
if (manager != null) {
MacAddress = manager.getConnectionInfo().getMacAddress();
}
return MacAddress;
}
/**
* 返回用户手机运营商名称 * @param telephonyManager * @return
*/
public static String getProvidersName(Application loanApplication) {
String ProvidersName = null;
try {
TelephonyManager telephonyManager = (TelephonyManager) loanApplication.getSystemService(Context.TELEPHONY_SERVICE);
String IMSI; // 返回唯一的用户ID;就是这张卡的编号神马的
IMSI = telephonyManager.getSubscriberId();
if (IMSI == null)
return "unkwon";
// IMSI号前面3位460是国家,紧接着后面2位00 02是中国移动,01是中国联通,03是中国电信。其中
if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {
ProvidersName = "中国移动";
} else if (IMSI.startsWith("46001")) {
ProvidersName = "中国联通";
} else if (IMSI.startsWith("46003")) {
ProvidersName = "中国电信";
}
ProvidersName = URLEncoder.encode("" + ProvidersName, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block e.printStackTrace();
}
return ProvidersName;
}
}
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 to comment