Commit 49d4e644 authored by maxiaoliang's avatar maxiaoliang

修改installRefer

parent 670c31b6
......@@ -19,7 +19,6 @@ object InstallHelps {
private val TAG = "InstallHelps"
@RequiresApi(Build.VERSION_CODES.O)
fun init() {
//InstallReferrer not empty
if (!TextUtils.isEmpty(AppPreferences.getInstance().getString("install_source", ""))) {
......@@ -79,7 +78,7 @@ object InstallHelps {
})
}
@RequiresApi(Build.VERSION_CODES.O)
fun requestCfg(callBackAd: Boolean) {
NewComUtils.requestCfg {
if (callBackAd) {
......
......@@ -2,7 +2,6 @@ package com.base.filerecoveryrecyclebin.utils
import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
import com.base.filerecoveryrecyclebin.BuildConfig
import com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import com.base.filerecoveryrecyclebin.bean.ConfigBean
......@@ -20,7 +19,6 @@ import java.net.URL
import java.util.Base64
import java.util.Locale
@RequiresApi(Build.VERSION_CODES.O)
object NewComUtils {
private val TAG = "NewComUtils"
private const val API_URL = ConfigHelper.apiUrl
......@@ -32,11 +30,18 @@ object NewComUtils {
private val url: String by lazy {
val packageName = ConfigHelper.packageName
val appCode = packageName.substringAfter(PACKAGE_NAME_PREFIX).take(5).toLowerCase(Locale.getDefault())
val bRefer =
Base64.getEncoder().encodeToString(AppPreferences.getInstance().getString("referrer", "").toByteArray())
if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){
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=${
AppPreferences.getInstance().getString("gid", "")
}&aid=${AppPreferences.getInstance().getString("uuid", "")}"
}else{
"$API_URL/${appCode}spk?pkg=$packageName&vn=${BuildConfig.VERSION_NAME}&vc=${BuildConfig.VERSION_CODE}&device=${
AppPreferences.getInstance().getString("gid", "")
}&aid=${AppPreferences.getInstance().getString("uuid", "")}"
}
// &mode=3
}
......
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