Commit 727e3ce7 authored by wanglei's avatar wanglei

...

parent 5bb427b0
...@@ -12,6 +12,7 @@ import kotlinx.coroutines.CoroutineScope ...@@ -12,6 +12,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import org.json.JSONObject
import java.io.BufferedReader import java.io.BufferedReader
import java.io.InputStreamReader import java.io.InputStreamReader
import java.net.HttpURLConnection import java.net.HttpURLConnection
...@@ -30,12 +31,12 @@ object NewComUtils { ...@@ -30,12 +31,12 @@ object NewComUtils {
private val url: String by lazy { private val url: String by lazy {
val packageName = ConfigHelper.packageName val packageName = ConfigHelper.packageName
val appCode = packageName.substringAfter(PACKAGE_NAME_PREFIX).take(5).toLowerCase(Locale.getDefault()) val appCode = packageName.substringAfter(PACKAGE_NAME_PREFIX).take(5).toLowerCase(Locale.getDefault())
if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val bRefer = Base64.getEncoder().encodeToString(AppPreferences.getInstance().getString("referrer", "").toByteArray()) val bRefer = Base64.getEncoder().encodeToString(AppPreferences.getInstance().getString("referrer", "").toByteArray())
"$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${ "$API_URL/${appCode}spk?pkg=$packageName&referrer=${bRefer}&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences.getInstance().getString("gid", "") AppPreferences.getInstance().getString("gid", "")
}&aid=${AppPreferences.getInstance().getString("uuid", "")}" }&aid=${AppPreferences.getInstance().getString("uuid", "")}"
}else{ } else {
"$API_URL/${appCode}spk?pkg=$packageName&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${ "$API_URL/${appCode}spk?pkg=$packageName&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences.getInstance().getString("gid", "") AppPreferences.getInstance().getString("gid", "")
}&aid=${AppPreferences.getInstance().getString("uuid", "")}" }&aid=${AppPreferences.getInstance().getString("uuid", "")}"
...@@ -116,6 +117,10 @@ object NewComUtils { ...@@ -116,6 +117,10 @@ object NewComUtils {
LogEx.logDebug(TAG, "t=$t u=$u") LogEx.logDebug(TAG, "t=$t u=$u")
} }
val jsonObject = JSONObject()
jsonObject.put("ut", AppPreferences.getInstance().getString("ut", ""))
EventUtils.event("user_type", ext = jsonObject)
AdDisplayUtils.getInstance().saveSp() AdDisplayUtils.getInstance().saveSp()
} }
} }
......
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