Skip to content

Commit

Permalink
update target sdk to 34
Browse files Browse the repository at this point in the history
  • Loading branch information
aderan committed Sep 18, 2024
1 parent ffb4cf1 commit f1971c0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
5 changes: 2 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ plugins {
}

android {
compileSdk 33
buildToolsVersion "33.0.0"
compileSdk 34

defaultConfig {
applicationId "io.agora.flat"
minSdkVersion 21
targetSdkVersion 33
targetSdk 34
versionCode 58
versionName "2.10.1"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import android.app.DownloadManager.Request
import android.app.DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Context.RECEIVER_EXPORTED
import android.content.Intent
import android.content.IntentFilter
import android.net.Uri
import android.os.Build
import android.os.Environment
import dagger.hilt.android.qualifiers.ApplicationContext
import java.io.File
Expand All @@ -26,7 +28,11 @@ class AndroidDownloader @Inject constructor(@ApplicationContext val context: Con
value?.run { cont.resume(desUri) }
}
}
context.registerReceiver(receiver, filter)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(receiver, filter, RECEIVER_EXPORTED)
} else {
context.registerReceiver(receiver, filter)
}
}

private val downloadManager: DownloadManager by lazy {
Expand Down
11 changes: 8 additions & 3 deletions app/src/main/java/io/agora/flat/common/login/LoginManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import android.app.Activity
import android.content.BroadcastReceiver
import android.content.ComponentName
import android.content.Context
import android.content.Context.RECEIVER_EXPORTED
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import com.tencent.mm.opensdk.constants.ConstantsAPI
import com.tencent.mm.opensdk.modelmsg.SendAuth
import com.tencent.mm.opensdk.openapi.IWXAPI
Expand All @@ -18,8 +20,7 @@ import javax.inject.Singleton

@Singleton
class LoginManager @Inject constructor(
@ApplicationContext val context: Context,
val appEnv: AppEnv
@ApplicationContext val context: Context, val appEnv: AppEnv
) {
private var api: IWXAPI? = null
private var wechatReceiver: BroadcastReceiver? = null
Expand All @@ -44,7 +45,11 @@ class LoginManager @Inject constructor(
}
}
}
context.registerReceiver(wechatReceiver, IntentFilter(ConstantsAPI.ACTION_REFRESH_WXAPP))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(wechatReceiver, IntentFilter(ConstantsAPI.ACTION_REFRESH_WXAPP), RECEIVER_EXPORTED)
} else {
context.registerReceiver(wechatReceiver, IntentFilter(ConstantsAPI.ACTION_REFRESH_WXAPP))
}
}

fun unregisterReceiver(context: Context) {
Expand Down

0 comments on commit f1971c0

Please sign in to comment.