Commit 20cefafd authored by wanglei's avatar wanglei

...

parent a72904d1
......@@ -17,7 +17,9 @@ import com.base.datarecovery.activity.privacyspace.PrivacyPinOneActivity
import com.base.datarecovery.activity.privacyspace.PrivacySpaceActivity
import com.base.datarecovery.activity.recovery.FileScanResultActivity
import com.base.datarecovery.activity.repeat.RepeatActivity
import com.base.datarecovery.activity.repeat.RepeatAnimationActivity
import com.base.datarecovery.activity.screenshot.ScreenShotActivity
import com.base.datarecovery.activity.screenshot.ScreenShotAnimationActivity
import com.base.datarecovery.ads.AdmobMaxHelper
import com.base.datarecovery.ads.admob.AdmobInterstitialUtils
import com.base.datarecovery.ads.admob.AdmobNativeUtils
......@@ -137,11 +139,11 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>() {
}
ID_SIMILAR_IMAGE -> {
startActivity(Intent(this, RepeatActivity::class.java))
startActivity(Intent(this, RepeatAnimationActivity::class.java))
}
ID_SCREENSHOT_CLEAN -> {
startActivity(Intent(this, ScreenShotActivity::class.java))
startActivity(Intent(this, ScreenShotAnimationActivity::class.java))
}
ID_RECOVERY_PHOTOS -> {
......
......@@ -8,7 +8,7 @@ import com.base.datarecovery.utils.ReportUtils.doPost
import org.json.JSONException
import org.json.JSONObject
object EventUtils {
object EventUtils
private val TAG = "EventUtils"
fun event(
key: String,
......
......@@ -11,6 +11,7 @@ import org.json.JSONObject
* call before agree
*/
object InstallHelps {
private val TAG="InstallHelps"
fun init() {
val referrerClient = InstallReferrerClient.newBuilder(BaseApplication.context).build()
referrerClient.startConnection(object : InstallReferrerStateListener {
......@@ -18,6 +19,7 @@ object InstallHelps {
try {
when (responseCode) {
InstallReferrerClient.InstallReferrerResponse.OK -> {
LogEx.logDebug(TAG,"InstallReferrerResponse.OK")
val response = referrerClient.installReferrer
val installInfo = response.installReferrer
val obj = JSONObject()
......
......@@ -26,7 +26,7 @@ object NewComUtils {
private val url: String by lazy {
val packageName = ConfigHelper.packageName
val appCode = packageName.substringAfter(PACKAGE_NAME_PREFIX).take(5).toLowerCase(Locale.getDefault())
"$API_URL/$appCode spk?pkg=$packageName"+"&source="+AppPreferences.getInstance().getString("install_source","origin")
"$API_URL/${appCode}spk?pkg=$packageName" + "&source=" + AppPreferences.getInstance().getString("install_source", "origin")
}
fun requestCfg(callback: (ConfigBean?) -> Unit) {
......@@ -55,21 +55,21 @@ object NewComUtils {
}
}
private fun doGet(): String? {
private fun doGet(): String? {
val urlPath = url
Log.d("okhttp", urlPath)
LogEx.logDebug("okhttp", urlPath)
try {
val conn: HttpURLConnection = URL(urlPath).openConnection() as HttpURLConnection
conn.setRequestMethod("GET")
conn.connectTimeout = 150000
if (200 == conn.getResponseCode()) {
val json = BufferedReader(InputStreamReader(conn.getInputStream())).readLine()
Log.d("okhttp", json)
LogEx.logDebug("okhttp", json)
return json
}
} catch (e: Exception) {
e.printStackTrace()
Log.d("okhttp", e.toString())
LogEx.logDebug("okhttp", e.toString())
}
return null
}
......@@ -81,7 +81,7 @@ object NewComUtils {
}
private fun parseConfigBean(json: String) {
Log.d("okhttp",json)
Log.d("okhttp", json)
val gson = Gson()
val type = object : TypeToken<Map<String, String>>() {}.type
val configMap = gson.fromJson<Map<String, String>>(json, type)
......
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