Add release signing, fix release build, update README
- Configure release signing via environment variables (android-signing-env) - Enable BuildConfig generation and guard HttpLoggingInterceptor to debug only - Move okhttp.logging to implementation so release build compiles - Update README: add E2EE, verification, push notifications, download link Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5791742c95
commit
d4b37437a3
3 changed files with 53 additions and 19 deletions
|
|
@ -18,6 +18,16 @@ android {
|
|||
versionName = "0.1.0"
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
create("release") {
|
||||
storeFile = file(System.getenv("ANDROID_KEYSTORE_PATH") ?: "")
|
||||
storeType = System.getenv("ANDROID_KEYSTORE_TYPE") ?: "PKCS12"
|
||||
keyAlias = System.getenv("ANDROID_KEY_ALIAS") ?: ""
|
||||
storePassword = System.getenv("ANDROID_KEYSTORE_PASSWORD") ?: ""
|
||||
keyPassword = System.getenv("ANDROID_KEY_PASSWORD") ?: ""
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
|
|
@ -25,6 +35,7 @@ android {
|
|||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -39,6 +50,7 @@ android {
|
|||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
buildConfig = true
|
||||
}
|
||||
|
||||
packaging {
|
||||
|
|
@ -68,5 +80,5 @@ dependencies {
|
|||
implementation(platform(libs.firebase.bom))
|
||||
implementation(libs.firebase.messaging)
|
||||
debugImplementation(libs.androidx.ui.tooling)
|
||||
debugImplementation(libs.okhttp.logging)
|
||||
implementation(libs.okhttp.logging)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ import android.util.Log
|
|||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import com.ltadeu6.matrix.BuildConfig
|
||||
import okhttp3.Interceptor
|
||||
import retrofit2.Retrofit
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
|
@ -1331,12 +1332,16 @@ class MatrixSession private constructor(private val appContext: Context) {
|
|||
}
|
||||
|
||||
private fun buildApi(homeserver: String) {
|
||||
val logging = HttpLoggingInterceptor().apply { level = HttpLoggingInterceptor.Level.BODY }
|
||||
val client = OkHttpClient.Builder()
|
||||
val clientBuilder = OkHttpClient.Builder()
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(60, TimeUnit.SECONDS)
|
||||
.addInterceptor(logging)
|
||||
.build()
|
||||
if (BuildConfig.DEBUG) {
|
||||
val logging = okhttp3.logging.HttpLoggingInterceptor().apply {
|
||||
level = okhttp3.logging.HttpLoggingInterceptor.Level.BODY
|
||||
}
|
||||
clientBuilder.addInterceptor(logging)
|
||||
}
|
||||
val client = clientBuilder.build()
|
||||
api = Retrofit.Builder()
|
||||
.baseUrl(homeserver)
|
||||
.client(client)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue