Update target SDK to 31 (Android 12)

This commit is contained in:
Julian Raufelder 2022-05-09 15:31:03 +02:00
parent 47131abd50
commit 39c8277904
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D
5 changed files with 54 additions and 20 deletions

View File

@ -21,8 +21,8 @@ allprojects {
ext {
androidBuildToolsVersion = "30.0.3"
androidMinSdkVersion = 26
androidTargetSdkVersion = 30
androidCompileSdkVersion = 30
androidTargetSdkVersion = 31
androidCompileSdkVersion = 31
// android and java libs
androidVersion = '4.1.1.4'

View File

@ -37,6 +37,7 @@
<activity
android:name=".ui.activity.SplashActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme">
<intent-filter>
@ -47,25 +48,31 @@
</activity>
<activity
android:name=".ui.activity.VaultListActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".ui.activity.ChooseCloudServiceActivity" />
<activity
android:name=".ui.activity.CreateVaultActivity"
android:exported="false"
android:windowSoftInputMode="stateVisible" />
<activity
android:name=".ui.activity.BrowseFilesActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.SetPasswordActivity"
android:exported="false"
android:windowSoftInputMode="stateVisible" />
<activity
android:name=".ui.activity.TextEditorActivity"
android:exported="false"
android:windowSoftInputMode="stateVisible" />
<activity
android:name=".ui.activity.SharedFilesActivity"
android:excludeFromRecents="true"
android:exported="true"
android:taskAffinity=".share"
android:windowSoftInputMode="stateHidden|adjustPan">
<intent-filter android:label="@string/share_with_label">
@ -80,12 +87,14 @@
<activity
android:name=".ui.activity.UnlockVaultActivity"
android:exported="false"
android:theme="@style/TransparentPopUp" />
<!-- Cloud Services -->
<activity
android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<data android:scheme="db-${DROPBOX_API_KEY}" />
@ -98,22 +107,40 @@
</activity>
<!-- Settings -->
<activity android:name=".ui.activity.AutoUploadChooseVaultActivity" />
<activity android:name=".ui.activity.BiometricAuthSettingsActivity" />
<activity android:name=".ui.activity.CloudConnectionListActivity" />
<activity android:name=".ui.activity.CloudSettingsActivity" />
<activity android:name=".ui.activity.LicensesActivity" />
<activity android:name=".ui.activity.SettingsActivity" />
<activity android:name=".ui.activity.WebDavAddOrChangeActivity" />
<activity android:name=".ui.activity.S3AddOrChangeActivity" />
<activity
android:name=".ui.activity.AutoUploadChooseVaultActivity"
android:exported="false" />
<activity
android:name=".ui.activity.BiometricAuthSettingsActivity"
android:exported="false" />
<activity
android:name=".ui.activity.CloudConnectionListActivity"
android:exported="false" />
<activity
android:name=".ui.activity.CloudSettingsActivity"
android:exported="false" />
<activity
android:name=".ui.activity.LicensesActivity"
android:exported="true" />
<activity
android:name=".ui.activity.SettingsActivity"
android:exported="false" />
<activity
android:name=".ui.activity.WebDavAddOrChangeActivity"
android:exported="false" />
<activity
android:name=".ui.activity.S3AddOrChangeActivity"
android:exported="false" />
<activity
android:name=".ui.activity.AuthenticateCloudActivity"
android:exported="false"
android:theme="@style/Theme.Transparent" />
<activity
android:name=".ui.activity.AuthenticatePCloudActivity"
android:configChanges="orientation|keyboard"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
@ -131,10 +158,12 @@
<activity
android:name=".ui.activity.ImagePreviewActivity"
android:exported="false"
android:theme="@style/FullscreenTheme" />
<activity
android:name=".ui.activity.LicenseCheckActivity"
android:exported="true"
android:launchMode="singleTask">
<intent-filter android:label="@string/dialog_enter_license_title">
<action android:name="android.intent.action.VIEW" />
@ -159,11 +188,15 @@
</intent-filter>
</activity>
<activity android:name="com.microsoft.identity.client.BrowserTabActivity">
<activity
android:name="com.microsoft.identity.client.BrowserTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="org.cryptomator"
android:path="/${ONEDRIVE_API_KEY_DECODED}"
@ -200,6 +233,7 @@
<receiver
android:name=".AutoPhotoUploadReceiver"
android:exported="true"
android:label="AutoPhotoUploadReceiver">
<intent-filter>
<action android:name="android.hardware.action.NEW_PICTURE" />
@ -209,7 +243,9 @@
</intent-filter>
</receiver>
<receiver android:name=".BootAwareReceiver">
<receiver
android:name=".BootAwareReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.ACTION_SHUTDOWN" />

View File

@ -48,7 +48,7 @@ class AutoUploadNotification(private val context: Context, private val amountOfP
private fun cancelNowAction(): NotificationCompat.Action {
val intentAction = cancelAutoUploadIntent(context)
val cancelIntent = PendingIntent.getService(context, 0, intentAction, FLAG_CANCEL_CURRENT)
val cancelIntent = PendingIntent.getService(context, 0, intentAction, FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE)
return NotificationCompat.Action.Builder( //
R.drawable.ic_lock, //
getString(R.string.notification_cancel_auto_upload), //
@ -60,7 +60,7 @@ class AutoUploadNotification(private val context: Context, private val amountOfP
val startTheActivity = Intent(context, VaultListActivity::class.java)
startTheActivity.action = ACTION_MAIN
startTheActivity.flags = FLAG_ACTIVITY_CLEAR_TASK or FLAG_ACTIVITY_NEW_TASK
return PendingIntent.getActivity(context, 0, startTheActivity, FLAG_CANCEL_CURRENT)
return PendingIntent.getActivity(context, 0, startTheActivity, FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun update(progress: Int) {

View File

@ -4,7 +4,6 @@ import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.NotificationManager.IMPORTANCE_LOW
import android.app.PendingIntent
import android.app.PendingIntent.FLAG_CANCEL_CURRENT
import android.content.Context
import android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION
import android.content.Intent.FLAG_GRANT_WRITE_URI_PERMISSION
@ -54,7 +53,7 @@ class OpenWritableFileNotification(private val context: Context, private val uri
private fun cancelNowIntent(): PendingIntent {
context.revokeUriPermission(uriToOpenendFile, FLAG_GRANT_WRITE_URI_PERMISSION or FLAG_GRANT_READ_URI_PERMISSION)
val startTheActivity = vaultListIntent().withStopEditFileNotification(true).build(context as ContextHolder)
return PendingIntent.getActivity(context, 0, startTheActivity, FLAG_CANCEL_CURRENT)
return PendingIntent.getActivity(context, 0, startTheActivity, PendingIntent.FLAG_CANCEL_CURRENT or PendingIntent.FLAG_IMMUTABLE)
}
fun show() {

View File

@ -16,7 +16,6 @@ import org.cryptomator.presentation.util.ResourceHelper;
import timber.log.Timber;
import static android.app.NotificationManager.IMPORTANCE_LOW;
import static android.app.PendingIntent.FLAG_CANCEL_CURRENT;
import static android.content.Intent.ACTION_MAIN;
import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
@ -73,15 +72,15 @@ class UnlockedNotification {
return PendingIntent.getService( //
service.getApplicationContext(), //
0, //
CryptorsService.lockAllIntent(service.getApplicationContext()), //
FLAG_CANCEL_CURRENT);
CryptorsService.lockAllIntent(service.getApplicationContext()),
PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
private PendingIntent startTheActivity() {
Intent startTheActivity = new Intent(service, VaultListActivity.class);
startTheActivity.setAction(ACTION_MAIN);
startTheActivity.setFlags(FLAG_ACTIVITY_CLEAR_TASK | FLAG_ACTIVITY_NEW_TASK);
return PendingIntent.getActivity(service, 0, startTheActivity, 0);
return PendingIntent.getActivity(service, 0, startTheActivity, PendingIntent.FLAG_IMMUTABLE);
}
public void setUnlockedCount(int unlocked) {