diff --git a/app/build.gradle b/app/build.gradle index 563da97..4b60c1d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,9 +18,9 @@ android { //targetSdkVersion compileSdkVersion targetSdkVersion 31 // 版本号:发布日期 - versionCode 20210902 + versionCode 20210907 // 版本名说明: R3.x.y.z (R3:Refactoring 第三次重构,z:Quick Fix序号) - versionName 'R3.12' + versionName 'R3.12.1' resConfigs "en", "zh-rCN" buildConfigField 'String', 'BUILD_TIME', '\"' + new Date() + '\"' @@ -139,10 +139,10 @@ dependencies { implementation "dev.rikka.shizuku:api:$shizuku_version" implementation "dev.rikka.shizuku:provider:$shizuku_version" - implementation 'github.ryuunoakaihitomi.poweract:poweract:1.5.1' - runtimeOnly 'github.ryuunoakaihitomi.retoast:retoast:1.7.3' + implementation 'github.ryuunoakaihitomi.poweract:poweract:1.5.3' + runtimeOnly 'github.ryuunoakaihitomi.retoast:retoast:1.7.4' implementation 'com.google.code.gson:gson:2.8.8' - implementation 'com.github.GrenderG:Toasty:1.5.0' + implementation 'com.github.GrenderG:Toasty:1.5.2' implementation 'com.github.topjohnwu.libsu:core:3.1.2' // 固定在此版本,理由同下段注释 // java.lang.NoClassDefFoundError: j$.wrappers.$r8$wrapper$java$util$function$Supplier$-WRP diff --git a/app/src/normal/java/github/ryuunoakaihitomi/powerpanel/stat/InternalDoerImpl.kt b/app/src/normal/java/github/ryuunoakaihitomi/powerpanel/stat/InternalDoerImpl.kt index 496376f..0721c39 100644 --- a/app/src/normal/java/github/ryuunoakaihitomi/powerpanel/stat/InternalDoerImpl.kt +++ b/app/src/normal/java/github/ryuunoakaihitomi/powerpanel/stat/InternalDoerImpl.kt @@ -1,33 +1,41 @@ package github.ryuunoakaihitomi.powerpanel.stat import android.content.Context +import android.os.Build import android.os.Bundle import com.google.firebase.analytics.ktx.analytics import com.google.firebase.crashlytics.ktx.crashlytics import com.google.firebase.ktx.Firebase import com.huawei.hms.analytics.HiAnalytics import com.huawei.hms.analytics.HiAnalyticsTools +import github.ryuunoakaihitomi.powerpanel.BuildConfig import timber.log.Timber /** - * 目前使用的是`Firebase` + * 目前使用的是`Firebase`和`Huawei AppGallery Collect` */ object InternalDoerImpl : InternalDoer { override fun initialize(ctx: Context) { - HiAnalyticsTools.enableLog() - HiAnalytics.getInstance(ctx) + if (BuildConfig.DEBUG) { + HiAnalyticsTools.enableLog() + } + // FIXME 等待华为分析服务适配Android 12 + // https://developer.huawei.com/consumer/cn/doc/development/HMSCore-Guides/version-change-history-0000001050705116 + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { + HiAnalytics.getInstance(ctx) + } } override fun setCustomKey(k: String, v: Any) { Firebase.crashlytics.apply { when (v) { is String -> setCustomKey(k, v) - is Boolean -> setCustomKey(k, v) is Int -> setCustomKey(k, v) is Long -> setCustomKey(k, v) is Float -> setCustomKey(k, v) is Double -> setCustomKey(k, v) + is Boolean -> setCustomKey(k, v) is Array<*> -> setCustomKey(k, v.contentToString()) else -> Timber.w("Undefined type: $k, $v") } diff --git a/build.gradle b/build.gradle index 6de858f..6c272d8 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { maven { url 'https://developer.huawei.com/repo/' } } dependencies { - classpath 'com.android.tools.build:gradle:7.0.1' + classpath 'com.android.tools.build:gradle:7.0.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" /* Crashlytics */