@@ -11,15 +11,19 @@ android {
|
||||
minSdk = libs.versions.minSdk.get().toInt()
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
//consumerProguardFiles("consumer-rules.pro")
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
isMinifyEnabled = false
|
||||
// proguardFiles(
|
||||
// getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
//// "proguard-rules.pro"
|
||||
// )
|
||||
}
|
||||
debug {
|
||||
isMinifyEnabled = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +47,7 @@ dependencies {
|
||||
implementation(libs.bundles.retrofit)
|
||||
implementation(libs.suncalc)
|
||||
implementation(libs.koin.android)
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.5.0")
|
||||
|
||||
implementation(project(":data:database"))
|
||||
implementation(project(":core:base"))
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
-keep class de.mm20.launcher2.weather.** { *; }
|
||||
-keep class kotlin.coroutines.Continuation
|
||||
-dontwarn edu.umd.cs.findbugs.annotations.Nullable
|
||||
#-keep class de.mm20.launcher2.weather.** { *; }
|
||||
#-keep class kotlin.coroutines.Continuation
|
||||
#-dontwarn edu.umd.cs.findbugs.annotations.Nullable
|
||||
#
|
||||
#-assumenosideeffects class android.util.Log {
|
||||
## public static *** d(...);
|
||||
# public static *** v(...);
|
||||
# public static *** i(...);
|
||||
# public static *** w(...);
|
||||
## public static *** e(...);
|
||||
#}
|
||||
Vendored
+27
-20
@@ -1,21 +1,28 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.kts.kts.kts.kts.kts.
|
||||
## Add project specific ProGuard rules here.
|
||||
## You can control the set of applied configuration files using the
|
||||
## proguardFiles setting in build.gradle.kts.kts.kts.kts.kts.
|
||||
##
|
||||
## For more details, see
|
||||
## http://developer.android.com/guide/developing/tools/proguard.html
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
## If your project uses WebView with JS, uncomment the following
|
||||
## and specify the fully qualified class name to the JavaScript interface
|
||||
## class:
|
||||
##-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
## public *;
|
||||
##}
|
||||
#
|
||||
## Uncomment this to preserve the line number information for
|
||||
## debugging stack traces.
|
||||
##-keepattributes SourceFile,LineNumberTable
|
||||
#
|
||||
## If you keep the line number information, uncomment this to
|
||||
## hide the original source file name.
|
||||
##-renamesourcefileattribute SourceFile
|
||||
#-assumenosideeffects class android.util.Log {
|
||||
## public static *** d(...);
|
||||
# public static *** v(...);
|
||||
# public static *** i(...);
|
||||
# public static *** w(...);
|
||||
## public static *** e(...);
|
||||
#}
|
||||
+17
@@ -7,9 +7,13 @@ import de.mm20.launcher2.preferences.weather.WeatherLocation
|
||||
import de.mm20.launcher2.weather.Forecast
|
||||
import de.mm20.launcher2.weather.R
|
||||
import de.mm20.launcher2.weather.WeatherProvider
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.converter.gson.GsonConverterFactory
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
import kotlin.getValue
|
||||
|
||||
internal class OpenWeatherMapProvider(
|
||||
private val context: Context,
|
||||
@@ -17,11 +21,24 @@ internal class OpenWeatherMapProvider(
|
||||
|
||||
private val retrofit by lazy {
|
||||
Retrofit.Builder()
|
||||
.client(client)
|
||||
.baseUrl("https://api.openweathermap.org/")
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.build()
|
||||
}
|
||||
private val client by lazy {
|
||||
val timeOutMillSeconds = 1500L
|
||||
OkHttpClient.Builder()
|
||||
.addInterceptor(HttpLoggingInterceptor().apply {
|
||||
level = HttpLoggingInterceptor.Level.BODY
|
||||
|
||||
})
|
||||
.callTimeout(timeOutMillSeconds,TimeUnit.MILLISECONDS)
|
||||
.connectTimeout(timeOutMillSeconds,TimeUnit.MILLISECONDS)
|
||||
.readTimeout(timeOutMillSeconds,TimeUnit.MILLISECONDS)
|
||||
.writeTimeout(timeOutMillSeconds,TimeUnit.MILLISECONDS)
|
||||
.build()
|
||||
}
|
||||
private val openWeatherMapService by lazy {
|
||||
retrofit.create(OpenWeatherMapApi::class.java)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!--<string name="openweathermap_key" translatable="false">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>-->
|
||||
<string name="openweathermap_key" translatable="false">87cd0810b7e4b4debd31a6ef98b98154"</string>
|
||||
<!--<string name="here_key" translatable="false">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</string>-->
|
||||
<!--<string name="metno_contact" translatable="false"></string>-->
|
||||
</resources>
|
||||
Reference in New Issue
Block a user