Commit 096d0d0c authored by guest's avatar guest

修改上报参数

parent 53c8cb50
......@@ -211,12 +211,7 @@
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".ui.webview.WebBrowserActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<provider
android:name="androidx.core.content.FileProvider"
......
......@@ -10,6 +10,7 @@ import com.base.pdfviewerscannerwhite.utils.AppPreferences
import com.base.pdfviewerscannerwhite.utils.LogEx
import org.json.JSONException
import org.json.JSONObject
import java.util.Locale
object EventUtils {
private val TAG = "EventUtils"
......@@ -45,8 +46,8 @@ object EventUtils {
.put("value", value)
.put("ext", ext)
val s2 = JSONObject()
.put("${pkg}_3", AppPreferences.getInstance().getString("Equipment", ""))
.put("${pkg}_4", AppPreferences.getInstance().getString("Manufacturer", ""))
.put("${pkg}_3", getDeviceName())
.put("${pkg}_4", Build.MANUFACTURER)
.put("${pkg}_5", Build.VERSION.SDK_INT)
.put("${pkg}_9", AppPreferences.getInstance().getString("uuid", ""))
.put("${pkg}_10", AppPreferences.getInstance().getString("gid", ""))
......@@ -84,5 +85,29 @@ object EventUtils {
url.append("?pkg=$pkg")
url.toString()
}
fun getDeviceName(): String? {
val manufacturer = Build.MANUFACTURER
val model = Build.MODEL
val flag = model.lowercase(Locale.getDefault()).startsWith(manufacturer.lowercase(Locale.getDefault()))
return if (flag) {
if (model.isNullOrEmpty()) {
model
} else {
model.substring(0, 1)
.uppercase(Locale.getDefault()) + model.substring(1)
.lowercase(Locale.getDefault())
}
} else {
val ss = if (manufacturer.isNullOrEmpty()) {
manufacturer
} else {
manufacturer.substring(0, 1)
.uppercase(Locale.getDefault()) + manufacturer.substring(1)
.lowercase(Locale.getDefault())
}
"$ss $model"
}
}
}
\ No newline at end of file
......@@ -18,11 +18,15 @@ import com.base.pdfviewerscannerwhite.utils.AppPreferences
import com.base.pdfviewerscannerwhite.utils.KotlinExt.toFormatMinute
import com.base.pdfviewerscannerwhite.utils.LogEx
import com.facebook.FacebookSdk
import com.google.android.gms.ads.identifier.AdvertisingIdClient
import com.reyun.solar.engine.OnAttributionListener
import com.reyun.solar.engine.OnInitializationCallback
import com.reyun.solar.engine.SolarEngineConfig
import com.reyun.solar.engine.SolarEngineManager
import com.tom_roush.pdfbox.android.PDFBoxResourceLoader
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import org.json.JSONObject
import java.util.Locale
import java.util.UUID
......@@ -61,7 +65,7 @@ class MyApplication : Application() {
initUUid()
initApp()
PDFBoxResourceLoader.init(applicationContext)
// initWeather()
// initWeather()
schedulePeriodicWork(this)
}
......@@ -80,6 +84,14 @@ class MyApplication : Application() {
}
fun initApp() {
MainScope().launch(Dispatchers.IO) {
try {
AppPreferences.getInstance()
.put("gid", AdvertisingIdClient.getAdvertisingIdInfo(context).id ?: "")
} catch (_: Exception) {
}
}
SolarEngineManager.getInstance().preInit(context, "81a11caa4076cd7c")
FacebookSdk.sdkInitialize(applicationContext) {
......@@ -96,7 +108,7 @@ class MyApplication : Application() {
LogEx.logDebug(TAG, "topic=${topic}")
FCMManager.initFirebase(this)
FCMManager.subscribeToTopic(topic)
// InstallHelps.init()
// InstallHelps.init()
initLifeListener()
ScreenStatusReceiver.setupScreenStatusListener(this)
......@@ -173,7 +185,12 @@ class MyApplication : Application() {
val flag = if (topActivity == null) {
true
} else {
ConfigHelper.noLoadingActivities.all { !topActivity.localClassName.contains(it, true) }
ConfigHelper.noLoadingActivities.all {
!topActivity.localClassName.contains(
it,
true
)
}
}
LogEx.logDebug(TAG, "flag=$flag" + " activity:" + activity.localClassName)
......
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