Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
R3.12.1
Browse files Browse the repository at this point in the history
在Android 12上禁用尚未与此兼容的华为分析服务
更新Toasty,加入了随深色模式自动变化的normal主题
  • Loading branch information
ryuunoakaihitomi committed Sep 7, 2021
1 parent fa9b74d commit 98f2119
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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() + '\"'
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 98f2119

Please sign in to comment.