diff --git a/app/build.gradle b/app/build.gradle index c90b8c72..a744537b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId = "info.dvkr.screenstream" minSdkVersion(21) targetSdkVersion(30) - versionCode = 30700 - versionName = "3.7.0" + versionCode = 30701 + versionName = "3.7.1" resConfigs("en", "ru", "pt-rBR", "zh-rTW", "fr-rFR", "fa", "it", "pl", "hi", "de", "sk", "es", "ar", "ja", "gl", "ca") vectorDrawables.useSupportLibrary = true @@ -36,9 +36,17 @@ android { } } + Properties localProps = new Properties() + File localProperties = new File(rootProject.rootDir, "local.properties") + if (localProperties.exists() && localProperties.isFile()) { + localProperties.withInputStream { localProps.load(it) } + } flavorDimensions("default") productFlavors { - create("firebase") {} + create("firebase") { + buildConfigField "String", "AD_UNIT_ID", localProps.getProperty("ad.unitId") + buildConfigField "String", "AD_UNIT_ID_TEST", localProps.getProperty("ad.unitIdTest") + } create("firebasefree") { firebaseCrashlytics.mappingFileUploadEnabled = false } @@ -102,7 +110,7 @@ dependencies { implementation(fileTree("libs/bottomsheets-release.aar")) // implementation("com.afollestad.material-dialogs:bottomsheets:3.3.0") - implementation("io.insert-koin:koin-android:3.1.0") + implementation("io.insert-koin:koin-android:3.1.1") implementation("com.github.iamironz:binaryprefs:1.0.1") implementation("com.elvishew:xlog:1.10.0") @@ -114,7 +122,7 @@ dependencies { exclude group: "androidx.core" } firebaseImplementation("com.google.firebase:firebase-analytics:19.0.0") - firebaseImplementation("com.google.firebase:firebase-crashlytics:18.0.1") + firebaseImplementation("com.google.firebase:firebase-crashlytics:18.1.0") firebaseImplementation("com.google.android.gms:play-services-ads:20.2.0") debugImplementation("com.squareup.leakcanary:leakcanary-android:2.7") diff --git a/app/src/firebase/kotlin/info/dvkr/screenstream/ui/activity/AdActivity.kt b/app/src/firebase/kotlin/info/dvkr/screenstream/ui/activity/AdActivity.kt index 177dc1f6..835162ce 100644 --- a/app/src/firebase/kotlin/info/dvkr/screenstream/ui/activity/AdActivity.kt +++ b/app/src/firebase/kotlin/info/dvkr/screenstream/ui/activity/AdActivity.kt @@ -5,6 +5,7 @@ import android.view.ViewTreeObserver import android.widget.FrameLayout import androidx.annotation.LayoutRes import com.google.android.gms.ads.* +import info.dvkr.screenstream.BuildConfig abstract class AdActivity(@LayoutRes contentLayoutId: Int) : AppUpdateActivity(contentLayoutId) { @@ -24,9 +25,9 @@ abstract class AdActivity(@LayoutRes contentLayoutId: Int) : AppUpdateActivity(c val adWidth = (adWidthPixels / outMetrics.density).toInt() val adSize = AdSize.getCurrentOrientationAnchoredAdaptiveBannerAdSize(this@AdActivity, adWidth) - // Device MUST be added to test devices - adView!!.adUnitId = "ca-app-pub-3406399667931208/3206361386" + adView!!.adUnitId = if (BuildConfig.DEBUG) BuildConfig.AD_UNIT_ID_TEST else BuildConfig.AD_UNIT_ID adView!!.adSize = adSize + adViewContainer.minimumHeight = adSize.getHeightInPixels(this@AdActivity) adView!!.loadAd(AdRequest.Builder().build()) adViewContainer.viewTreeObserver.removeOnGlobalLayoutListener(this) diff --git a/build.gradle b/build.gradle index e1a7a157..01bd3eaf 100644 --- a/build.gradle +++ b/build.gradle @@ -6,9 +6,9 @@ buildscript { dependencies { classpath("com.android.tools.build:gradle:4.2.1") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20") classpath("com.google.gms:google-services:4.3.8") - classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.0") + classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.1") } } diff --git a/data/build.gradle b/data/build.gradle index b4adba74..56fa24f6 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion(21) targetSdkVersion(30) - versionCode = 30700 - versionName = "3.7.0" + versionCode = 30701 + versionName = "3.7.1" } compileOptions { @@ -28,7 +28,7 @@ android { dependencies { implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0") - implementation("org.jetbrains.kotlin:kotlin-reflect:1.5.10") + implementation("org.jetbrains.kotlin:kotlin-reflect:1.5.20") implementation("androidx.core:core:1.5.0")