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 { ext {
androidBuildToolsVersion = "30.0.3" androidBuildToolsVersion = "30.0.3"
androidMinSdkVersion = 26 androidMinSdkVersion = 26
androidTargetSdkVersion = 30 androidTargetSdkVersion = 31
androidCompileSdkVersion = 30 androidCompileSdkVersion = 31
// android and java libs // android and java libs
androidVersion = '4.1.1.4' androidVersion = '4.1.1.4'

View File

@ -37,6 +37,7 @@
<activity <activity
android:name=".ui.activity.SplashActivity" android:name=".ui.activity.SplashActivity"
android:exported="true"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/SplashTheme"> android:theme="@style/SplashTheme">
<intent-filter> <intent-filter>
@ -47,25 +48,31 @@
</activity> </activity>
<activity <activity
android:name=".ui.activity.VaultListActivity" android:name=".ui.activity.VaultListActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity android:name=".ui.activity.ChooseCloudServiceActivity" /> <activity android:name=".ui.activity.ChooseCloudServiceActivity" />
<activity <activity
android:name=".ui.activity.CreateVaultActivity" android:name=".ui.activity.CreateVaultActivity"
android:exported="false"
android:windowSoftInputMode="stateVisible" /> android:windowSoftInputMode="stateVisible" />
<activity <activity
android:name=".ui.activity.BrowseFilesActivity" android:name=".ui.activity.BrowseFilesActivity"
android:exported="false"
android:windowSoftInputMode="adjustPan" /> android:windowSoftInputMode="adjustPan" />
<activity <activity
android:name=".ui.activity.SetPasswordActivity" android:name=".ui.activity.SetPasswordActivity"
android:exported="false"
android:windowSoftInputMode="stateVisible" /> android:windowSoftInputMode="stateVisible" />
<activity <activity
android:name=".ui.activity.TextEditorActivity" android:name=".ui.activity.TextEditorActivity"
android:exported="false"
android:windowSoftInputMode="stateVisible" /> android:windowSoftInputMode="stateVisible" />
<activity <activity
android:name=".ui.activity.SharedFilesActivity" android:name=".ui.activity.SharedFilesActivity"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:exported="true"
android:taskAffinity=".share" android:taskAffinity=".share"
android:windowSoftInputMode="stateHidden|adjustPan"> android:windowSoftInputMode="stateHidden|adjustPan">
<intent-filter android:label="@string/share_with_label"> <intent-filter android:label="@string/share_with_label">
@ -80,12 +87,14 @@
<activity <activity
android:name=".ui.activity.UnlockVaultActivity" android:name=".ui.activity.UnlockVaultActivity"
android:exported="false"
android:theme="@style/TransparentPopUp" /> android:theme="@style/TransparentPopUp" />
<!-- Cloud Services --> <!-- Cloud Services -->
<activity <activity
android:name="com.dropbox.core.android.AuthActivity" android:name="com.dropbox.core.android.AuthActivity"
android:configChanges="orientation|keyboard" android:configChanges="orientation|keyboard"
android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
<data android:scheme="db-${DROPBOX_API_KEY}" /> <data android:scheme="db-${DROPBOX_API_KEY}" />
@ -98,22 +107,40 @@
</activity> </activity>
<!-- Settings --> <!-- Settings -->
<activity android:name=".ui.activity.AutoUploadChooseVaultActivity" /> <activity
<activity android:name=".ui.activity.BiometricAuthSettingsActivity" /> android:name=".ui.activity.AutoUploadChooseVaultActivity"
<activity android:name=".ui.activity.CloudConnectionListActivity" /> android:exported="false" />
<activity android:name=".ui.activity.CloudSettingsActivity" /> <activity
<activity android:name=".ui.activity.LicensesActivity" /> android:name=".ui.activity.BiometricAuthSettingsActivity"
<activity android:name=".ui.activity.SettingsActivity" /> android:exported="false" />
<activity android:name=".ui.activity.WebDavAddOrChangeActivity" /> <activity
<activity android:name=".ui.activity.S3AddOrChangeActivity" /> 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 <activity
android:name=".ui.activity.AuthenticateCloudActivity" android:name=".ui.activity.AuthenticateCloudActivity"
android:exported="false"
android:theme="@style/Theme.Transparent" /> android:theme="@style/Theme.Transparent" />
<activity <activity
android:name=".ui.activity.AuthenticatePCloudActivity" android:name=".ui.activity.AuthenticatePCloudActivity"
android:configChanges="orientation|keyboard" android:configChanges="orientation|keyboard"
android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
@ -131,10 +158,12 @@
<activity <activity
android:name=".ui.activity.ImagePreviewActivity" android:name=".ui.activity.ImagePreviewActivity"
android:exported="false"
android:theme="@style/FullscreenTheme" /> android:theme="@style/FullscreenTheme" />
<activity <activity
android:name=".ui.activity.LicenseCheckActivity" android:name=".ui.activity.LicenseCheckActivity"
android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter android:label="@string/dialog_enter_license_title"> <intent-filter android:label="@string/dialog_enter_license_title">
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
@ -159,11 +188,15 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="com.microsoft.identity.client.BrowserTabActivity"> <activity
android:name="com.microsoft.identity.client.BrowserTabActivity"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data <data
android:host="org.cryptomator" android:host="org.cryptomator"
android:path="/${ONEDRIVE_API_KEY_DECODED}" android:path="/${ONEDRIVE_API_KEY_DECODED}"
@ -200,6 +233,7 @@
<receiver <receiver
android:name=".AutoPhotoUploadReceiver" android:name=".AutoPhotoUploadReceiver"
android:exported="true"
android:label="AutoPhotoUploadReceiver"> android:label="AutoPhotoUploadReceiver">
<intent-filter> <intent-filter>
<action android:name="android.hardware.action.NEW_PICTURE" /> <action android:name="android.hardware.action.NEW_PICTURE" />
@ -209,7 +243,9 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<receiver android:name=".BootAwareReceiver"> <receiver
android:name=".BootAwareReceiver"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.ACTION_SHUTDOWN" /> <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 { private fun cancelNowAction(): NotificationCompat.Action {
val intentAction = cancelAutoUploadIntent(context) 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( // return NotificationCompat.Action.Builder( //
R.drawable.ic_lock, // R.drawable.ic_lock, //
getString(R.string.notification_cancel_auto_upload), // 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) val startTheActivity = Intent(context, VaultListActivity::class.java)
startTheActivity.action = ACTION_MAIN startTheActivity.action = ACTION_MAIN
startTheActivity.flags = FLAG_ACTIVITY_CLEAR_TASK or FLAG_ACTIVITY_NEW_TASK 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) { fun update(progress: Int) {

View File

@ -4,7 +4,6 @@ import android.app.NotificationChannel
import android.app.NotificationManager import android.app.NotificationManager
import android.app.NotificationManager.IMPORTANCE_LOW import android.app.NotificationManager.IMPORTANCE_LOW
import android.app.PendingIntent import android.app.PendingIntent
import android.app.PendingIntent.FLAG_CANCEL_CURRENT
import android.content.Context import android.content.Context
import android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION import android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION
import android.content.Intent.FLAG_GRANT_WRITE_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 { private fun cancelNowIntent(): PendingIntent {
context.revokeUriPermission(uriToOpenendFile, FLAG_GRANT_WRITE_URI_PERMISSION or FLAG_GRANT_READ_URI_PERMISSION) context.revokeUriPermission(uriToOpenendFile, FLAG_GRANT_WRITE_URI_PERMISSION or FLAG_GRANT_READ_URI_PERMISSION)
val startTheActivity = vaultListIntent().withStopEditFileNotification(true).build(context as ContextHolder) 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() { fun show() {

View File

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