From 71931cf6976cd6c71bbc6a90de4fe795dd4a6c38 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Mon, 15 Jan 2024 20:55:26 +0600 Subject: [PATCH] Add back analytics --- app/build.gradle.kts | 7 ++++ app/proguard-rules.pro | 4 +++ app/src/main/AndroidManifest.xml | 10 ++++++ app/src/standard/google-services.json | 48 +++++++++++++++++++++++++++ build.gradle.kts | 1 + gradle/libs.versions.toml | 3 ++ 6 files changed, 73 insertions(+) create mode 100644 app/src/standard/google-services.json diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 17871bd8a..dec3efc91 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -8,6 +8,10 @@ plugins { id("com.github.zellius.shortcut-helper") } +if (gradle.startParameter.taskRequests.toString().contains("Standard")) { + apply() +} + shortcutHelper.setFilePath("./shortcuts.xml") val SUPPORTED_ABIS = setOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64") @@ -238,6 +242,9 @@ dependencies { // Logging implementation(libs.logcat) + // Crash reports/analytics + "standardImplementation"(libs.firebase.analytics) + // Shizuku implementation(libs.bundles.shizuku) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index f3538e0fd..64220f2b1 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -71,3 +71,7 @@ # XmlUtil -keep public enum nl.adaptivity.xmlutil.EventType { *; } + +# Firebase +-keep class com.google.firebase.installations.** { *; } +-keep interface com.google.firebase.installations.** { *; } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f73e2e706..30805627c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -33,6 +33,11 @@ + + + + + + diff --git a/app/src/standard/google-services.json b/app/src/standard/google-services.json new file mode 100644 index 000000000..7992dd97f --- /dev/null +++ b/app/src/standard/google-services.json @@ -0,0 +1,48 @@ +{ + "project_info": { + "project_number": "82031285239", + "project_id": "mihonapp", + "storage_bucket": "mihonapp.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:82031285239:android:336ed6dceef55c357594f2", + "android_client_info": { + "package_name": "app.mihon" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDTvOxBQnuXADx5isKxoynPG0nlAO8bQbk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:82031285239:android:b7440cbdd0d33c9d7594f2", + "android_client_info": { + "package_name": "app.mihon.debug" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyDTvOxBQnuXADx5isKxoynPG0nlAO8bQbk" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + } + ], + "configuration_version": "1" +} diff --git a/build.gradle.kts b/build.gradle.kts index d684e4a35..ad3a21a2e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,6 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile buildscript { dependencies { classpath(libs.android.shortcut.gradle) + classpath(libs.google.services.gradle) classpath(libs.aboutLibraries.gradle) classpath(libs.sqldelight.gradle) classpath(libs.moko.gradle) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d0520faa8..479c3b44a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -12,6 +12,7 @@ voyager = "1.0.0" [libraries] desugar = "com.android.tools:desugar_jdk_libs:2.0.4" android-shortcut-gradle = "com.github.zellius:android-shortcut-gradle-plugin:0.1.2" +google-services-gradle = "com.google.gms:google-services:4.4.0" rxjava = "io.reactivex:rxjava:1.3.8" @@ -66,6 +67,8 @@ moko-gradle = { module = "dev.icerock.moko:resources-generator", version.ref = " logcat = "com.squareup.logcat:logcat:0.1" +firebase-analytics = "com.google.firebase:firebase-analytics-ktx:21.5.0" + aboutLibraries-gradle = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin", version.ref = "aboutlib_version" } aboutLibraries-compose = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutlib_version" }