1、优化更新友盟统计
This commit is contained in:
shenzuqiang 2026-03-12 18:40:42 +08:00
parent 10baf69f73
commit 818d285ccb
6 changed files with 18 additions and 12 deletions

View File

@ -4,10 +4,10 @@
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
<DropdownSelection timestamp="2026-03-12T09:56:24.310095400Z">
<DropdownSelection timestamp="2026-03-12T10:17:50.197535700Z">
<Target type="DEFAULT_BOOT">
<handle>
<DeviceId pluginId="PhysicalDevice" identifier="serial=Y5DELZR46DZTCI9D" />
<DeviceId pluginId="PhysicalDevice" identifier="serial=JRBI89BIE6AI5TG6" />
</handle>
</Target>
</DropdownSelection>

View File

@ -78,9 +78,9 @@ android {
// 使用相对路径,请确保 bidinfo.keystore 放在 app 目录下
val keystorePath = project.findProperty("RELEASE_STORE_FILE") as? String ?: "bidinfo.keystore"
storeFile = file(keystorePath)
storePassword = project.findProperty("RELEASE_STORE_PASSWORD") as? String ?: "你的密码"
keyAlias = project.findProperty("RELEASE_KEY_ALIAS") as? String ?: "你的别名"
keyPassword = project.findProperty("RELEASE_KEY_PASSWORD") as? String ?: "你的密码"
storePassword = project.findProperty("RELEASE_STORE_PASSWORD") as? String ?: ""
keyAlias = project.findProperty("RELEASE_KEY_ALIAS") as? String ?: ""
keyPassword = project.findProperty("RELEASE_KEY_PASSWORD") as? String ?: ""
enableV1Signing = true
enableV2Signing = true

View File

@ -10,6 +10,7 @@ import com.github.gzuliyujiang.oaid.DeviceID
import com.github.gzuliyujiang.oaid.IGetter
import com.img.rabbit.config.Constants
import com.img.rabbit.provider.storage.PreferenceUtil
import com.img.rabbit.utils.ChannelUtils
import com.tencent.mmkv.MMKV
import com.umeng.analytics.MobclickAgent
import com.umeng.commonsdk.UMConfigure
@ -36,13 +37,13 @@ class BaseApplication : Application() {
initMMKV()
// 初始化个推SDK
initGeTuiOneKeyLogin()
// 初始化友盟
initUM()
// 初始化OAID和uni-app SDK
initOAIDAndUniAPPSdk()
//需要在隐私框架下才能处理的逻辑
if(PreferenceUtil.getAgreement()){
//用户已同意隐私政策
// 初始化友盟(每次启动时检查协议是否同意,如同意进行初始化)
initUM()
}
}
@ -59,12 +60,16 @@ class BaseApplication : Application() {
*/
private fun initUM() {
UMConfigure.setLogEnabled(true)
// 1. 必须在 init 之前设置
UMConfigure.setProcessEvent(true)
// 2. 预初始化(合规要求)
UMConfigure.preInit(this, Constants.UmengAppkey, ChannelUtils.getChannel(this))
// 3. 直接执行正式初始化
PlatformConfig.setFileProvider("${BuildConfig.APPLICATION_ID}.fileprovider")
PlatformConfig.setWeixin(Constants.WxAppId, Constants.WxSecret)
UMConfigure.init(this, Constants.UmengAppkey, ChannelUtils.getChannel(this), UMConfigure.DEVICE_TYPE_PHONE, "")
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.AUTO)
UMConfigure.setProcessEvent(true)
}
private fun initGeTuiOneKeyLogin() {

View File

@ -165,7 +165,6 @@ class MainActivity : ComponentActivity(), LoadingCallback {
if (generalViewModel.serverTime.value != null){
// 获取用户配置
loginViewModel.requestUserConfig(isInitConfig = true)
initUM()
}
}
@ -274,6 +273,7 @@ class MainActivity : ComponentActivity(), LoadingCallback {
if (isAllowPrivacyPolicy) {
generalViewModel.setIsAgreement(true)
loginViewModel.setIsPolicyAgreement(true)
initUM()
showSplash = true
} else {
// 不同意隐私协议政策,直接退出应用
@ -418,7 +418,7 @@ class MainActivity : ComponentActivity(), LoadingCallback {
}
/**
* 初始化友盟
* 初始化友盟(同意协议的时候进行一次初始化)
*/
private fun initUM() {
UMConfigure.preInit(applicationContext, Constants.UmengAppkey, ChannelUtils.getChannel(applicationContext))

View File

@ -12,7 +12,7 @@ object Constants {
const val WxSecret = "5264c353296db25405fc29e43c40d3a5"//微信secret
const val UmengAppkey = "69a641119a7f3764887cd287"// 友盟appKey
const val AppId = ""//appid
const val AppId = "10058"//appid
//解密
const val AESDecrypt = "e4rOtnF8tJjtHO7ecZeJHN1rapED5ImB"

View File

@ -120,6 +120,7 @@ pictureselector = { module = "io.github.lucksiege:pictureselector", version.ref
compress = { module = "io.github.lucksiege:compress", version.ref = "compress" }
segmentation-selfie = { module = "com.google.mlkit:segmentation-selfie", version.ref = "segmentationSelfie" }
face-detection = { module = "com.google.mlkit:face-detection", version.ref = "faceDetection" }
#noinspection SimilarGradleDependency
androidx-foundation = { group = "androidx.compose.foundation", name = "foundation", version.ref = "foundation" }
android-gif-drawable = { module = "pl.droidsonroids.gif:android-gif-drawable", version.ref = "androidGifDrawableEncoder" }
gif-encoder = { module = "com.squareup:gifencoder", version.ref = "gifeEncoder" }