Commit ae8cbd71 authored by mengcuiguang's avatar mengcuiguang

手机号、微信登录、提现上传app应用信息

parent 9fa2feb6
......@@ -15,6 +15,7 @@ import android.telephony.TelephonyManager
import android.text.TextUtils
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.library.utils.json.JsonUtil
import java.io.*
import java.net.NetworkInterface
import java.util.*
......@@ -372,6 +373,39 @@ class DeviceInfo private constructor() {
return sb.toString()
}
/**
* 获取APP列表信息
*/
fun getAppInfoMap(): String {
try {
val appList: MutableList<MutableMap<String, String>> = ArrayList()
val mainintent = Intent(Intent.ACTION_MAIN, null)
mainintent.addCategory(Intent.CATEGORY_LAUNCHER)
val packageinfo =
mContext!!.packageManager.getInstalledPackages(0)
var pinfo: PackageInfo? = null
val count = packageinfo.size
for (i in 0 until count) {
pinfo = packageinfo[i]
val appInfo = pinfo.applicationInfo
if (appInfo.flags and ApplicationInfo.FLAG_SYSTEM > 0) {
//系统程序 忽略
} else {
//非系统程序
val appMap: MutableMap<String, String> = HashMap()
appMap["appName"] = appInfo.loadLabel(mContext!!.packageManager) as String
appMap["appPkg"] = pinfo.packageName
appList.add(appMap)
}
}
return JsonUtil.toJson(appList)
} catch (e: Exception) {
e.printStackTrace()
}
return ""
}
/**
* Android ID
*
......
......@@ -136,6 +136,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("appPkgList", deviceInfo.getAppInfoMap());
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo.put("oaid", MintsApplication.OAID);
}
......
......@@ -242,6 +242,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
vo["appPkgList"] = deviceInfo.getAppInfoMap()
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
......
......@@ -16,6 +16,7 @@ import com.mints.goodmoney.ad.banner.BannerManager
import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.manager.*
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter
......
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