Commit 49d4e644 authored by maxiaoliang's avatar maxiaoliang

修改installRefer

parent 670c31b6
...@@ -19,7 +19,6 @@ object InstallHelps { ...@@ -19,7 +19,6 @@ object InstallHelps {
private val TAG = "InstallHelps" private val TAG = "InstallHelps"
@RequiresApi(Build.VERSION_CODES.O)
fun init() { fun init() {
//InstallReferrer not empty //InstallReferrer not empty
if (!TextUtils.isEmpty(AppPreferences.getInstance().getString("install_source", ""))) { if (!TextUtils.isEmpty(AppPreferences.getInstance().getString("install_source", ""))) {
...@@ -79,7 +78,7 @@ object InstallHelps { ...@@ -79,7 +78,7 @@ object InstallHelps {
}) })
} }
@RequiresApi(Build.VERSION_CODES.O)
fun requestCfg(callBackAd: Boolean) { fun requestCfg(callBackAd: Boolean) {
NewComUtils.requestCfg { NewComUtils.requestCfg {
if (callBackAd) { if (callBackAd) {
......
...@@ -2,7 +2,6 @@ package com.base.filerecoveryrecyclebin.utils ...@@ -2,7 +2,6 @@ package com.base.filerecoveryrecyclebin.utils
import android.os.Build import android.os.Build
import android.util.Log import android.util.Log
import androidx.annotation.RequiresApi
import com.base.filerecoveryrecyclebin.BuildConfig import com.base.filerecoveryrecyclebin.BuildConfig
import com.base.filerecoveryrecyclebin.ads.AdDisplayUtils import com.base.filerecoveryrecyclebin.ads.AdDisplayUtils
import com.base.filerecoveryrecyclebin.bean.ConfigBean import com.base.filerecoveryrecyclebin.bean.ConfigBean
...@@ -20,7 +19,6 @@ import java.net.URL ...@@ -20,7 +19,6 @@ import java.net.URL
import java.util.Base64 import java.util.Base64
import java.util.Locale import java.util.Locale
@RequiresApi(Build.VERSION_CODES.O)
object NewComUtils { object NewComUtils {
private val TAG = "NewComUtils" private val TAG = "NewComUtils"
private const val API_URL = ConfigHelper.apiUrl private const val API_URL = ConfigHelper.apiUrl
...@@ -32,11 +30,18 @@ object NewComUtils { ...@@ -32,11 +30,18 @@ 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())
val bRefer = if(Build.VERSION.SDK_INT >=Build.VERSION_CODES.O){
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{
"$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 // &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