Threema 4 år sedan
förälder
incheckning
557b69f33d
100 ändrade filer med 326 tillägg och 213 borttagningar
  1. 3 3
      app/build.gradle
  2. 1 1
      app/src/androidTest/java/ch/threema/app/DangerousTest.java
  3. 1 1
      app/src/androidTest/java/ch/threema/app/ScreenshotTakingRule.java
  4. 1 1
      app/src/androidTest/java/ch/threema/app/TestApplication.java
  5. 1 1
      app/src/androidTest/java/ch/threema/app/TestFastlaneOnly.java
  6. 1 1
      app/src/androidTest/java/ch/threema/app/ThreemaTestRunner.java
  7. 1 1
      app/src/androidTest/java/ch/threema/app/backuprestore/csv/BackupServiceTest.java
  8. 1 1
      app/src/androidTest/java/ch/threema/app/emojis/MarkupParserTest.java
  9. 1 1
      app/src/androidTest/java/ch/threema/app/processors/MessageAckProcessorTest.java
  10. 1 1
      app/src/androidTest/java/ch/threema/app/processors/MessageProcessorTest.java
  11. 1 1
      app/src/androidTest/java/ch/threema/app/service/GroupInviteServiceTest.java
  12. 1 1
      app/src/androidTest/java/ch/threema/app/testutils/CaptureLogcatOnTestFailureRule.java
  13. 1 1
      app/src/androidTest/java/ch/threema/app/testutils/InstructionUtil.java
  14. 1 1
      app/src/androidTest/java/ch/threema/app/testutils/RecyclerViewMatcher.java
  15. 1 1
      app/src/androidTest/java/ch/threema/app/testutils/TestHelpers.java
  16. 1 1
      app/src/androidTest/java/ch/threema/app/testutils/ThreemaAssert.java
  17. 1 1
      app/src/androidTest/java/ch/threema/app/utils/BackgroundErrorNotificationTest.java
  18. 1 1
      app/src/androidTest/java/ch/threema/app/utils/TextUtilTest.java
  19. 1 1
      app/src/androidTest/java/ch/threema/app/voip/SdpTest.java
  20. 1 1
      app/src/androidTest/java/ch/threema/app/voip/VoipStatusMessageTest.java
  21. 1 1
      app/src/androidTest/java/ch/threema/app/webclient/activities/SessionsActivityTest.java
  22. 1 1
      app/src/androidTest/java/ch/threema/app/webclient/converter/MessageTest.java
  23. 1 1
      app/src/androidTest/java/ch/threema/app/webclient/converter/MsgpackTest.java
  24. 1 1
      app/src/androidTest/java/ch/threema/logging/backend/DebugLogFileBackendTest.java
  25. 1 1
      app/src/google_services_based/java/ch/threema/app/push/PushRegistrationWorker.java
  26. 1 1
      app/src/google_services_based/java/ch/threema/app/push/PushService.java
  27. 1 1
      app/src/google_services_based/java/ch/threema/app/wearable/WearableHandler.java
  28. 1 1
      app/src/hms/java/ch/threema/app/activities/DownloadApkActivity.java
  29. 1 1
      app/src/hms/java/ch/threema/app/utils/DownloadUtil.java
  30. 1 1
      app/src/hms_services_based/java/ch/threema/app/push/PushRegistrationWorker.java
  31. 1 1
      app/src/hms_services_based/java/ch/threema/app/push/PushService.java
  32. 1 1
      app/src/hms_services_based/java/ch/threema/app/wearable/WearableHandler.java
  33. 1 1
      app/src/hms_work/java/ch/threema/app/activities/DownloadApkActivity.java
  34. 1 1
      app/src/hms_work/java/ch/threema/app/utils/DownloadUtil.java
  35. 39 0
      app/src/main/AndroidManifest.xml
  36. 1 1
      app/src/main/java/androidx/appcompat/widget/PopupMenuWrapper.java
  37. 1 1
      app/src/main/java/androidx/core/app/FixedJobIntentService.java
  38. 1 1
      app/src/main/java/ch/threema/annotation/SameThread.java
  39. 1 1
      app/src/main/java/ch/threema/app/AutostartService.java
  40. 1 1
      app/src/main/java/ch/threema/app/BuildFlavor.java
  41. 1 1
      app/src/main/java/ch/threema/app/NamedFileProvider.java
  42. 122 84
      app/src/main/java/ch/threema/app/ThreemaApplication.java
  43. 1 1
      app/src/main/java/ch/threema/app/ThreemaLicensePolicy.java
  44. 1 1
      app/src/main/java/ch/threema/app/actions/LocationMessageSendAction.java
  45. 1 1
      app/src/main/java/ch/threema/app/actions/SendAction.java
  46. 1 1
      app/src/main/java/ch/threema/app/actions/TextMessageSendAction.java
  47. 1 1
      app/src/main/java/ch/threema/app/activities/AboutActivity.java
  48. 1 1
      app/src/main/java/ch/threema/app/activities/AddAccountActivity.java
  49. 21 3
      app/src/main/java/ch/threema/app/activities/AddContactActivity.java
  50. 1 1
      app/src/main/java/ch/threema/app/activities/AppLinksActivity.java
  51. 1 1
      app/src/main/java/ch/threema/app/activities/BackupAdminActivity.java
  52. 1 1
      app/src/main/java/ch/threema/app/activities/BiometricLockActivity.java
  53. 1 1
      app/src/main/java/ch/threema/app/activities/BlackListActivity.java
  54. 13 9
      app/src/main/java/ch/threema/app/activities/ComposeMessageActivity.java
  55. 5 4
      app/src/main/java/ch/threema/app/activities/ContactDetailActivity.java
  56. 1 1
      app/src/main/java/ch/threema/app/activities/ContactNotificationsActivity.java
  57. 1 1
      app/src/main/java/ch/threema/app/activities/CropImageActivity.java
  58. 1 1
      app/src/main/java/ch/threema/app/activities/DirectoryActivity.java
  59. 1 1
      app/src/main/java/ch/threema/app/activities/DisableBatteryOptimizationsActivity.java
  60. 1 1
      app/src/main/java/ch/threema/app/activities/DistributionListAddActivity.java
  61. 1 1
      app/src/main/java/ch/threema/app/activities/DummyActivity.java
  62. 1 1
      app/src/main/java/ch/threema/app/activities/EnterSerialActivity.java
  63. 1 1
      app/src/main/java/ch/threema/app/activities/ExcludedSyncIdentitiesActivity.java
  64. 1 1
      app/src/main/java/ch/threema/app/activities/ExportIDActivity.java
  65. 1 1
      app/src/main/java/ch/threema/app/activities/ExportIDResultActivity.java
  66. 1 1
      app/src/main/java/ch/threema/app/activities/GroupAdd2Activity.java
  67. 1 1
      app/src/main/java/ch/threema/app/activities/GroupAddActivity.java
  68. 2 2
      app/src/main/java/ch/threema/app/activities/GroupDetailActivity.java
  69. 1 1
      app/src/main/java/ch/threema/app/activities/GroupEditActivity.java
  70. 1 1
      app/src/main/java/ch/threema/app/activities/GroupNotificationsActivity.java
  71. 1 1
      app/src/main/java/ch/threema/app/activities/HomeActivity.java
  72. 1 1
      app/src/main/java/ch/threema/app/activities/IdentityListActivity.java
  73. 1 1
      app/src/main/java/ch/threema/app/activities/ImagePaintActivity.java
  74. 1 1
      app/src/main/java/ch/threema/app/activities/ImagePaintKeyboardActivity.java
  75. 1 1
      app/src/main/java/ch/threema/app/activities/LicenseActivity.java
  76. 1 1
      app/src/main/java/ch/threema/app/activities/MainActivity.java
  77. 1 1
      app/src/main/java/ch/threema/app/activities/MapActivity.java
  78. 1 1
      app/src/main/java/ch/threema/app/activities/MediaGalleryActivity.java
  79. 1 1
      app/src/main/java/ch/threema/app/activities/MediaViewerActivity.java
  80. 1 1
      app/src/main/java/ch/threema/app/activities/MemberChooseActivity.java
  81. 1 1
      app/src/main/java/ch/threema/app/activities/NotificationsActivity.java
  82. 1 1
      app/src/main/java/ch/threema/app/activities/PinLockActivity.java
  83. 1 1
      app/src/main/java/ch/threema/app/activities/PrivacyPolicyActivity.java
  84. 1 1
      app/src/main/java/ch/threema/app/activities/ProfilePicRecipientsActivity.java
  85. 1 1
      app/src/main/java/ch/threema/app/activities/QRCodeZoomActivity.java
  86. 1 1
      app/src/main/java/ch/threema/app/activities/RecipientListActivity.java
  87. 29 16
      app/src/main/java/ch/threema/app/activities/RecipientListBaseActivity.java
  88. 1 1
      app/src/main/java/ch/threema/app/activities/SMSVerificationLinkActivity.java
  89. 1 1
      app/src/main/java/ch/threema/app/activities/SendMediaActivity.java
  90. 1 1
      app/src/main/java/ch/threema/app/activities/ServerMessageActivity.java
  91. 1 1
      app/src/main/java/ch/threema/app/activities/SimpleWebViewActivity.java
  92. 1 1
      app/src/main/java/ch/threema/app/activities/StickerSelectorActivity.java
  93. 1 1
      app/src/main/java/ch/threema/app/activities/StopPassphraseServiceActivity.java
  94. 1 1
      app/src/main/java/ch/threema/app/activities/StorageManagementActivity.java
  95. 1 1
      app/src/main/java/ch/threema/app/activities/SupportActivity.java
  96. 1 1
      app/src/main/java/ch/threema/app/activities/TextChatBubbleActivity.java
  97. 1 1
      app/src/main/java/ch/threema/app/activities/ThreemaActivity.java
  98. 1 1
      app/src/main/java/ch/threema/app/activities/ThreemaAppCompatActivity.java
  99. 1 1
      app/src/main/java/ch/threema/app/activities/ThreemaToolbarActivity.java
  100. 1 1
      app/src/main/java/ch/threema/app/activities/UnlockMasterKeyActivity.java

+ 3 - 3
app/build.gradle

@@ -20,7 +20,7 @@ if (getGradle().getStartParameter().getTaskRequests().toString().contains("Hms")
 }
 
 // version codes
-def app_version = "4.62"
+def app_version = "4.63"
 def beta_suffix = "" // with leading dash
 
 /**
@@ -99,7 +99,7 @@ android {
         vectorDrawables.useSupportLibrary = true
         applicationId "ch.threema.app"
         testApplicationId 'ch.threema.app.test'
-        versionCode 709
+        versionCode 712
         versionName "${app_version}${beta_suffix}"
         resValue "string", "app_name", "Threema"
         // package name used for sync adapter
@@ -662,6 +662,7 @@ dependencies {
     implementation "androidx.lifecycle:lifecycle-common-java8:2.3.1"
     implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
     implementation "androidx.paging:paging-runtime:3.0.1"
+    implementation "androidx.sharetarget:sharetarget:1.1.0"
 
     implementation 'com.google.android.material:material:1.4.0'
     implementation 'com.google.android.exoplayer:exoplayer-core:2.15.1'
@@ -698,7 +699,6 @@ dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
     implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3"
 
-
     // use leak canary in debug builds
 //    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5'
 

+ 1 - 1
app/src/androidTest/java/ch/threema/app/DangerousTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/ScreenshotTakingRule.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/TestApplication.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2017-2021 Threema GmbH
+ * Copyright (c) 2017-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/TestFastlaneOnly.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/ThreemaTestRunner.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2017-2021 Threema GmbH
+ * Copyright (c) 2017-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/backuprestore/csv/BackupServiceTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/emojis/MarkupParserTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/processors/MessageAckProcessorTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/processors/MessageProcessorTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/service/GroupInviteServiceTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/testutils/CaptureLogcatOnTestFailureRule.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/testutils/InstructionUtil.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2017-2021 Threema GmbH
+ * Copyright (c) 2017-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/testutils/RecyclerViewMatcher.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2017-2021 Threema GmbH
+ * Copyright (c) 2017-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/testutils/TestHelpers.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/testutils/ThreemaAssert.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/utils/BackgroundErrorNotificationTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/utils/TextUtilTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/voip/SdpTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/voip/VoipStatusMessageTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/webclient/activities/SessionsActivityTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/webclient/converter/MessageTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/app/webclient/converter/MsgpackTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2017-2021 Threema GmbH
+ * Copyright (c) 2017-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/androidTest/java/ch/threema/logging/backend/DebugLogFileBackendTest.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/google_services_based/java/ch/threema/app/push/PushRegistrationWorker.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/google_services_based/java/ch/threema/app/push/PushService.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/google_services_based/java/ch/threema/app/wearable/WearableHandler.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/hms/java/ch/threema/app/activities/DownloadApkActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/hms/java/ch/threema/app/utils/DownloadUtil.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/hms_services_based/java/ch/threema/app/push/PushRegistrationWorker.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/hms_services_based/java/ch/threema/app/push/PushService.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/hms_services_based/java/ch/threema/app/wearable/WearableHandler.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2021 Threema GmbH
+ * Copyright (c) 2021-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/hms_work/java/ch/threema/app/activities/DownloadApkActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/hms_work/java/ch/threema/app/utils/DownloadUtil.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 39 - 0
app/src/main/AndroidManifest.xml

@@ -116,6 +116,40 @@
 		android:name="android.hardware.camera.any"
 		android:required="false"/>
 
+	<queries>
+		<!-- various power manager and autostart packages we may need to direct our users to -->
+		<package android:name="com.samsung.android.lool" />
+		<package android:name="com.huawei.systemmanager" />
+		<package android:name="com.iqoo.secure" />
+		<package android:name="com.vivo.permissionmanager" />
+		<package android:name="com.htc.pitroad" />
+		<package android:name="com.miui.securitycenter" />
+		<package android:name="com.letv.android.letvsafe" />
+		<package android:name="com.coloros.safecenter" />
+		<package android:name="com.oppo.safe" />
+		<package android:name="com.asus.mobilemanager" />
+		<package android:name="com.transsion.phonemanager" />
+
+		<intent>
+			<action android:name="miui.intent.action.POWER_HIDE_MODE_APP_LIST"/>
+			<category android:name="android.intent.category.DEFAULT"/>
+		</intent>
+		<intent>
+			<action android:name="miui.intent.action.OP_AUTO_START"/>
+			<category android:name="android.intent.category.DEFAULT"/>
+		</intent>
+		<intent>
+			<action android:name="android.intent.action.SEND" />
+			<data android:mimeType="text/plain" />
+		</intent>
+		<intent>
+			<action android:name="android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS" />
+		</intent>
+		<intent>
+			<action android:name="android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS" />
+		</intent>
+	</queries>
+
 	<uses-sdk tools:overrideLibrary="androidx.camera.core, androidx.camera.camera2,
 		androidx.camera.lifecycle, androidx.camera.view, me.zhanghai.android.fastscroll" />
 
@@ -848,6 +882,11 @@
 			android:enabled="true"
 			android:exported="false"
 			android:permission="android.permission.BIND_JOB_SERVICE"/>
+		<service
+			android:name=".jobs.ShareTargetShortcutUpdateJobService"
+			android:enabled="true"
+			android:exported="false"
+			android:permission="android.permission.BIND_JOB_SERVICE"/>
 
 		<!-- broadcast receivers -->
 		<receiver

+ 1 - 1
app/src/main/java/androidx/appcompat/widget/PopupMenuWrapper.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/androidx/core/app/FixedJobIntentService.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/annotation/SameThread.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/AutostartService.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/BuildFlavor.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/NamedFileProvider.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 122 - 84
app/src/main/java/ch/threema/app/ThreemaApplication.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,
@@ -91,6 +91,7 @@ import ch.threema.app.backuprestore.csv.BackupService;
 import ch.threema.app.exceptions.DatabaseMigrationFailedException;
 import ch.threema.app.exceptions.FileSystemNotPresentException;
 import ch.threema.app.grouplinks.IncomingGroupJoinRequestListener;
+import ch.threema.app.jobs.ShareTargetShortcutUpdateJobService;
 import ch.threema.app.jobs.WorkSyncJobService;
 import ch.threema.app.jobs.WorkSyncService;
 import ch.threema.app.listeners.BallotVoteListener;
@@ -125,7 +126,6 @@ import ch.threema.app.services.MessageService;
 import ch.threema.app.services.MessageServiceImpl;
 import ch.threema.app.services.NotificationService;
 import ch.threema.app.services.PreferenceService;
-import ch.threema.app.services.ShortcutService;
 import ch.threema.app.services.SynchronizeContactsService;
 import ch.threema.app.services.UpdateSystemService;
 import ch.threema.app.services.UpdateSystemServiceImpl;
@@ -263,6 +263,7 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 	public static final int MIN_PW_LENGTH_ID_EXPORT_LEGACY = 4; // extremely ancient versions of the app on some platform accepted four-letter passwords when generating ID exports
 
 	private static final int WORK_SYNC_JOB_ID = 63339;
+	public static final int SHORTCUTS_UPDATE_JOB_ID = 63340;
 
 	private static final String WORKER_IDENTITY_STATES_PERIODIC_NAME = "IdentityStates";
 
@@ -273,7 +274,6 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 	private static volatile MasterKey masterKey;
 
 	private static Date lastLoggedIn;
-	private static long lastNotificationTimeStamp;
 	private static boolean isDeviceIdle;
 	private static boolean ipv6 = false;
 	private static HashMap<String, String> messageDrafts = new HashMap<>();
@@ -950,24 +950,15 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 				scheduleWorkSync(preferenceStore);
 				// schedule identity states / feature masks etc.
 				scheduleIdentityStatesSync(preferenceStore);
+				// schedule shortcut update
+				if (preferenceStore.getBoolean(getAppContext().getString(R.string.preferences__direct_share))) {
+					scheduleShareTargetShortcutUpdate();
+
+				}
 			}, "scheduleSync").start();
 
 			initMapbox();
 
-			// publish most recent chats or pinned shortcuts as sharing targets
-			new Thread(() -> {
-				ShortcutService shortcutService;
-				try {
-					shortcutService = serviceManager.getShortcutService();
-					if (shortcutService != null) {
-						shortcutService.deleteDynamicShortcuts();
-						shortcutService.publishRecentChatsAsSharingTargets();
-					}
-				} catch (ThreemaException e) {
-					logger.error("Exception, failed to publish sharing shortcut targets", e);
-				}
-			}, "createShareTargets").start();
-
 			// setup locale override
 			ConfigUtils.setLocaleOverride(getAppContext(), serviceManager.getPreferenceService());
 		} catch (MasterKeyLockedException e) {
@@ -1083,6 +1074,23 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 		return false;
 	}
 
+	@WorkerThread
+	public static boolean scheduleShareTargetShortcutUpdate() {
+		logger.info("Scheduling share target shortcut update job");
+
+		JobScheduler jobScheduler = (JobScheduler) context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
+		if (jobScheduler != null) {
+			ComponentName serviceComponent = new ComponentName(context, ShareTargetShortcutUpdateJobService.class);
+			JobInfo.Builder builder = new JobInfo.Builder(SHORTCUTS_UPDATE_JOB_ID, serviceComponent)
+				.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)
+				.setPeriodic(DateUtils.MINUTE_IN_MILLIS * 15);
+			jobScheduler.schedule(builder.build());
+			return true;
+		}
+		logger.debug("Unable to schedule share target update job");
+		return false;
+	}
+
 	private static void configureListeners() {
 		ListenerManager.groupListeners.add(new GroupListener() {
 			@Override
@@ -1099,41 +1107,50 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 
 			@Override
 			public void onRename(GroupModel groupModel) {
-				try {
-					serviceManager.getConversationService().refresh(groupModel);
-					serviceManager.getMessageService().createStatusMessage(
+				new Thread(() -> {
+					try {
+						MessageReceiver messageReceiver = serviceManager.getGroupService().createReceiver(groupModel);
+						serviceManager.getConversationService().refresh(groupModel);
+						serviceManager.getMessageService().createStatusMessage(
 							serviceManager.getContext().getString(R.string.status_rename_group, groupModel.getName()),
-							serviceManager.getGroupService().createReceiver(groupModel));
-					serviceManager.getShortcutService().updateShortcut(groupModel);
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+							messageReceiver);
+						serviceManager.getShortcutService().updatePinnedShortcut(messageReceiver);
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
 			}
 
 			@Override
 			public void onUpdatePhoto(GroupModel groupModel) {
-				try {
-					serviceManager.getConversationService().refresh(groupModel);
-					serviceManager.getMessageService().createStatusMessage(
+				new Thread(() -> {
+					try {
+						MessageReceiver messageReceiver = serviceManager.getGroupService().createReceiver(groupModel);
+
+						serviceManager.getConversationService().refresh(groupModel);
+						serviceManager.getMessageService().createStatusMessage(
 							serviceManager.getContext().getString(R.string.status_group_new_photo),
-							serviceManager.getGroupService().createReceiver(groupModel));
-					serviceManager.getShortcutService().updateShortcut(groupModel);
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+							messageReceiver);
+						serviceManager.getShortcutService().updatePinnedShortcut(messageReceiver);
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
 			}
 
 			@Override
 			public void onRemove(GroupModel groupModel) {
-				try {
-					final MessageReceiver receiver = serviceManager.getGroupService().createReceiver(groupModel);
-					serviceManager.getBallotService().remove(receiver);
-					serviceManager.getConversationService().removed(groupModel);
-					serviceManager.getNotificationService().cancel(new GroupMessageReceiver(groupModel, null, null, null, null, serviceManager.getApiService()));
-					serviceManager.getShortcutService().deleteShortcut(groupModel);
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+				new Thread(() -> {
+					try {
+						final MessageReceiver receiver = serviceManager.getGroupService().createReceiver(groupModel);
+						serviceManager.getBallotService().remove(receiver);
+						serviceManager.getConversationService().removed(groupModel);
+						serviceManager.getNotificationService().cancel(new GroupMessageReceiver(groupModel, null, null, null, null, serviceManager.getApiService()));
+						serviceManager.getShortcutService().deletePinnedShortcut(receiver);
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
 			}
 
 			@Override
@@ -1273,12 +1290,14 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 
 			@Override
 			public void onLeave(GroupModel groupModel) {
-				try {
-					serviceManager.getConversationService().refresh(groupModel);
-					serviceManager.getShortcutService().deleteShortcut(groupModel);
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+				new Thread(() -> {
+					try {
+						serviceManager.getConversationService().refresh(groupModel);
+						serviceManager.getShortcutService().deletePinnedShortcut(serviceManager.getGroupService().createReceiver(groupModel));
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
 			}
 
 			@Override
@@ -1301,23 +1320,27 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 
 			@Override
 			public void onModify(DistributionListModel distributionListModel) {
-				try {
-					serviceManager.getConversationService().refresh(distributionListModel);
-					serviceManager.getShortcutService().updateShortcut(distributionListModel);
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+				new Thread(() -> {
+					try {
+						serviceManager.getConversationService().refresh(distributionListModel);
+						serviceManager.getShortcutService().updatePinnedShortcut(serviceManager.getDistributionListService().createReceiver(distributionListModel));
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
 			}
 
 
 			@Override
 			public void onRemove(DistributionListModel distributionListModel) {
-				try {
-					serviceManager.getConversationService().removed(distributionListModel);
-					serviceManager.getShortcutService().deleteShortcut(distributionListModel);
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+				new Thread(() -> {
+					try {
+						serviceManager.getConversationService().removed(distributionListModel);
+						serviceManager.getShortcutService().deletePinnedShortcut(serviceManager.getDistributionListService().createReceiver(distributionListModel));
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
 			}
 		}, THREEMA_APPLICATION_LISTENER_TAG);
 
@@ -1460,12 +1483,25 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 		ListenerManager.contactListeners.add(new ContactListener() {
 			@Override
 			public void onModified(ContactModel modifiedContactModel) {
-				try {
-					serviceManager.getConversationService().refresh(modifiedContactModel);
-					serviceManager.getShortcutService().updateShortcut(modifiedContactModel);
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+				new Thread(() -> {
+					try {
+						serviceManager.getConversationService().refresh(modifiedContactModel);
+						serviceManager.getShortcutService().updatePinnedShortcut(serviceManager.getContactService().createReceiver(modifiedContactModel));
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
+			}
+
+			@Override
+			public void onAvatarChanged(ContactModel contactModel) {
+				new Thread(() -> {
+					try {
+						serviceManager.getShortcutService().updatePinnedShortcut(serviceManager.getContactService().createReceiver(contactModel));
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
+					}
+				}).start();
 			}
 
 			@Override
@@ -1473,28 +1509,30 @@ public class ThreemaApplication extends MultiDexApplication implements DefaultLi
 
 			@Override
 			public void onRemoved(ContactModel removedContactModel) {
-				try {
-					serviceManager.getConversationService().removed(removedContactModel);
-					serviceManager.getShortcutService().deleteShortcut(removedContactModel);
+				new Thread(() -> {
+					try {
+						serviceManager.getConversationService().removed(removedContactModel);
+						serviceManager.getShortcutService().deletePinnedShortcut(serviceManager.getContactService().createReceiver(removedContactModel));
 
-					//remove notification from this contact
+						//remove notification from this contact
 
-					//hack. create a receiver to become the notification id
-					serviceManager.getNotificationService().cancel(new ContactMessageReceiver
+						//hack. create a receiver to become the notification id
+						serviceManager.getNotificationService().cancel(new ContactMessageReceiver
 							(
-									removedContactModel,
-									serviceManager.getContactService(),
-									null, null, null, null, serviceManager.getApiService()));
-
-					//remove custom avatar (ANDR-353)
-					FileService f = serviceManager.getFileService();
-					if (f != null) {
-						f.removeContactAvatar(removedContactModel);
-						f.removeContactPhoto(removedContactModel);
+								removedContactModel,
+								serviceManager.getContactService(),
+								null, null, null, null, serviceManager.getApiService()));
+
+						//remove custom avatar (ANDR-353)
+						FileService f = serviceManager.getFileService();
+						if (f != null) {
+							f.removeContactAvatar(removedContactModel);
+							f.removeContactPhoto(removedContactModel);
+						}
+					} catch (ThreemaException e) {
+						logger.error("Exception", e);
 					}
-				} catch (ThreemaException e) {
-					logger.error("Exception", e);
-				}
+				}).start();
 			}
 		}, THREEMA_APPLICATION_LISTENER_TAG);
 

+ 1 - 1
app/src/main/java/ch/threema/app/ThreemaLicensePolicy.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/actions/LocationMessageSendAction.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/actions/SendAction.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/actions/TextMessageSendAction.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/AboutActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/AddAccountActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 21 - 3
app/src/main/java/ch/threema/app/activities/AddContactActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,
@@ -58,6 +58,7 @@ import ch.threema.app.services.QRCodeService;
 import ch.threema.app.utils.AppRestrictionUtil;
 import ch.threema.app.utils.ConfigUtils;
 import ch.threema.app.utils.DialogUtil;
+import ch.threema.app.utils.IntentDataUtil;
 import ch.threema.app.utils.LogUtil;
 import ch.threema.app.utils.QRScannerUtil;
 import ch.threema.app.utils.TestUtil;
@@ -245,6 +246,23 @@ public class AddContactActivity extends ThreemaActivity implements GenericAlertD
 		super.onDestroy();
 	}
 
+	/**
+	 * start a web client session (payload must be validated before
+	 * the method is called)
+	 *
+	 * fix #ANDR-570
+	 * @param payload a valid payload
+	 */
+	private void startWebClientByQRResult(final byte[] payload) {
+		if (payload != null) {
+			// start web client session screen with payload data and finish my screen
+			Intent webClientIntent = new Intent(this, ch.threema.app.webclient.activities.SessionsActivity.class);
+			IntentDataUtil.append(payload, webClientIntent);
+			this.finish();
+			startActivity(webClientIntent);
+		}
+	}
+
 	@SuppressLint("StaticFieldLeak")
 	private void addContactByQRResult(final QRCodeService.QRCodeContentResult qrResult) {
 		if (qrResult.getExpirationDate() != null
@@ -348,7 +366,7 @@ public class AddContactActivity extends ThreemaActivity implements GenericAlertD
 			if (ConfigUtils.supportsGroupLinks()) {
 				QRScannerUtil.getInstance().initiateGeneralThreemaQrScanner(this, getString(R.string.qr_scanner_id_hint));
 			} else {
-				QRScannerUtil.getInstance().initiateScan(this, false, null);
+				QRScannerUtil.getInstance().initiateScan(this, false, getString(R.string.qr_scanner_id_hint));
 			}
 		}
 	}
@@ -414,7 +432,7 @@ public class AddContactActivity extends ThreemaActivity implements GenericAlertD
 						final QRCodeParser webClientQRCodeParser = new QRCodeParserImpl();
 						webClientQRCodeParser.parse(base64Payload); // throws if QR is not valid
 						// it was a valid web client qr code, exit method
-					//	startWebClientByQRResult(base64Payload);
+						startWebClientByQRResult(base64Payload);
 						return;
 					}
 				} catch (IOException | QRCodeParser.InvalidQrCodeException x) {

+ 1 - 1
app/src/main/java/ch/threema/app/activities/AppLinksActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/BackupAdminActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/BiometricLockActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/BlackListActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 13 - 9
app/src/main/java/ch/threema/app/activities/ComposeMessageActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,
@@ -245,16 +245,20 @@ public class ComposeMessageActivity extends ThreemaToolbarActivity implements Ge
 	private boolean checkHiddenChatLock(Intent intent, int requestCode) {
 		MessageReceiver messageReceiver = IntentDataUtil.getMessageReceiverFromIntent(getApplicationContext(), intent);
 
-		if (messageReceiver != null && serviceManager != null) {
-			DeadlineListService hiddenChatsListService = serviceManager.getHiddenChatsListService();
-			if (hiddenChatsListService != null && hiddenChatsListService.has(messageReceiver.getUniqueIdString())) {
-				if (preferenceService != null && ConfigUtils.hasProtection(preferenceService)) {
-					HiddenChatUtil.launchLockCheckDialog(this, null, preferenceService, requestCode);
-				} else {
-					GenericAlertDialog.newInstance(R.string.hide_chat, R.string.hide_chat_enter_message_explain, R.string.set_lock, R.string.cancel).show(getSupportFragmentManager(), DIALOG_TAG_HIDDEN_NOTICE);
+		if (messageReceiver != null) {
+			if (serviceManager != null) {
+				DeadlineListService hiddenChatsListService = serviceManager.getHiddenChatsListService();
+				if (hiddenChatsListService != null && hiddenChatsListService.has(messageReceiver.getUniqueIdString())) {
+					if (preferenceService != null && ConfigUtils.hasProtection(preferenceService)) {
+						HiddenChatUtil.launchLockCheckDialog(this, null, preferenceService, requestCode);
+					} else {
+						GenericAlertDialog.newInstance(R.string.hide_chat, R.string.hide_chat_enter_message_explain, R.string.set_lock, R.string.cancel).show(getSupportFragmentManager(), DIALOG_TAG_HIDDEN_NOTICE);
+					}
+					return true;
 				}
-				return true;
 			}
+		} else {
+			logger.info("Intent does not have any extras. Check \"Don't keep activities\" option in developer settings.");
 		}
 		return false;
 	}

+ 5 - 4
app/src/main/java/ch/threema/app/activities/ContactDetailActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,
@@ -777,7 +777,7 @@ public class ContactDetailActivity extends ThreemaToolbarActivity
 	}
 
 	private void scanQR() {
-		QRScannerUtil.getInstance().initiateScan(this, false, null);
+		QRScannerUtil.getInstance().initiateScan(this, false, getString(R.string.qr_scanner_id_hint));
 	}
 
 	@Override
@@ -882,9 +882,10 @@ public class ContactDetailActivity extends ThreemaToolbarActivity
 	public void onYes(String tag, Object data) {
 		switch (tag) {
 			case DIALOG_TAG_DELETE_CONTACT:
-				deleteContact((ContactModel) data);
+				ContactModel contactModel = (ContactModel)data;
+				deleteContact(contactModel);
 				try {
-					serviceManager.getShortcutService().deleteShortcut((ContactModel) data);
+					serviceManager.getShortcutService().deletePinnedShortcut(contactService.createReceiver(contactModel));
 				} catch (ThreemaException e) {
 					logger.error("Exception, failed to delete direct share shortcut", e);
 				}

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ContactNotificationsActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/CropImageActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/DirectoryActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/DisableBatteryOptimizationsActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2016-2021 Threema GmbH
+ * Copyright (c) 2016-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/DistributionListAddActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/DummyActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/EnterSerialActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ExcludedSyncIdentitiesActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ExportIDActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ExportIDResultActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/GroupAdd2Activity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/GroupAddActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 2 - 2
app/src/main/java/ch/threema/app/activities/GroupDetailActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,
@@ -866,7 +866,7 @@ public class GroupDetailActivity extends GroupEditActivity implements SelectorDi
 			case DIALOG_TAG_DELETE_GROUP:
 				deleteGroupAndQuit();
 				try {
-					serviceManager.getShortcutService().deleteShortcut((groupModel));
+					serviceManager.getShortcutService().deletePinnedShortcut(groupService.createReceiver(groupModel));
 				} catch (ThreemaException e) {
 					logger.debug("Exception, failed to delete direct group shortcut", e);
 				}

+ 1 - 1
app/src/main/java/ch/threema/app/activities/GroupEditActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/GroupNotificationsActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/HomeActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/IdentityListActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ImagePaintActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2016-2021 Threema GmbH
+ * Copyright (c) 2016-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ImagePaintKeyboardActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2017-2021 Threema GmbH
+ * Copyright (c) 2017-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/LicenseActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/MainActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/MapActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2019-2021 Threema GmbH
+ * Copyright (c) 2019-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/MediaGalleryActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/MediaViewerActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/MemberChooseActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/NotificationsActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/PinLockActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/PrivacyPolicyActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ProfilePicRecipientsActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/QRCodeZoomActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/RecipientListActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 29 - 16
app/src/main/java/ch/threema/app/activities/RecipientListBaseActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,
@@ -32,6 +32,7 @@ import android.location.Location;
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.BadParcelableException;
+import android.os.BaseBundle;
 import android.os.Bundle;
 import android.os.Parcelable;
 import android.provider.DocumentsContract;
@@ -68,6 +69,7 @@ import androidx.appcompat.widget.SearchView;
 import androidx.core.app.ActivityCompat;
 import androidx.core.app.TaskStackBuilder;
 import androidx.core.content.ContextCompat;
+import androidx.core.content.pm.ShortcutManagerCompat;
 import androidx.fragment.app.Fragment;
 import androidx.fragment.app.FragmentManager;
 import androidx.fragment.app.FragmentPagerAdapter;
@@ -99,6 +101,7 @@ import ch.threema.app.services.FileService;
 import ch.threema.app.services.GroupService;
 import ch.threema.app.services.MessageService;
 import ch.threema.app.services.PreferenceService;
+import ch.threema.app.services.ShortcutService;
 import ch.threema.app.services.UserService;
 import ch.threema.app.ui.MediaItem;
 import ch.threema.app.ui.SingleToast;
@@ -165,6 +168,7 @@ public class RecipientListBaseActivity extends ThreemaToolbarActivity implements
 	private DistributionListService distributionListService;
 	private MessageService messageService;
 	private FileService fileService;
+	private ShortcutService shortcutService;
 
 	private final Runnable copyFilesRunnable = new Runnable() {
 		@Override
@@ -242,6 +246,7 @@ public class RecipientListBaseActivity extends ThreemaToolbarActivity implements
 			this.distributionListService = serviceManager.getDistributionListService();
 			this.messageService = serviceManager.getMessageService();
 			this.fileService = serviceManager.getFileService();
+			this.shortcutService = serviceManager.getShortcutService();
 			userService = serviceManager.getUserService();
 		} catch (Exception e) {
 			logger.error("Exception", e);
@@ -400,21 +405,21 @@ public class RecipientListBaseActivity extends ThreemaToolbarActivity implements
 			}
 
 			String identity = IntentDataUtil.getIdentity(intent);
-			int groupId = -1;
-			int distributionListID = -1;
-			//check for receiver information either through intent extras or sharing shortcut id which looses its intent extras
-			// (workaround to pass identity extras in shortcut id https://medium.com/@styrc.adam/android-dynamic-shortcuts-passing-extras-64db534621c1)
-			if (TestUtil.empty(identity)) {
-				identity = IntentDataUtil.getIdentityFromSharingShortcut(intent);
-				if (TestUtil.empty(identity)) {
-					groupId = IntentDataUtil.getGroupId(intent);
-
-					if (groupId == -1) {
-						groupId = IntentDataUtil.getGroupIdFromSharingShortcut(intent);
-
-						if (groupId == -1) {
-							// distribution list is only passed as id to recipient activity, no check for intent extras
-							distributionListID = IntentDataUtil.getDistributionListIdFromSharingShortcut(intent);
+			int groupId = IntentDataUtil.getGroupId(intent);
+			int distributionListID = IntentDataUtil.getDistributionListId(intent);
+
+			if (TestUtil.empty(identity) && groupId == -1 && distributionListID == -1) {
+				// maybe a shortcut?
+				String id = intent.getStringExtra(ShortcutManagerCompat.EXTRA_SHORTCUT_ID);
+				if (!TestUtil.empty(id)) {
+					BaseBundle bundle = shortcutService.getShareTargetExtrasFromShortcutId(id);
+					if (bundle != null) {
+						if (bundle.containsKey(ThreemaApplication.INTENT_DATA_CONTACT)) {
+							identity = bundle.getString(ThreemaApplication.INTENT_DATA_CONTACT);
+						} else if (bundle.containsKey(ThreemaApplication.INTENT_DATA_GROUP)) {
+							groupId = bundle.getInt(ThreemaApplication.INTENT_DATA_GROUP);
+						} else if (bundle.containsKey(ThreemaApplication.INTENT_DATA_DISTRIBUTION_LIST)) {
+							distributionListID = bundle.getInt(ThreemaApplication.INTENT_DATA_DISTRIBUTION_LIST);
 						}
 					}
 				}
@@ -587,6 +592,14 @@ public class RecipientListBaseActivity extends ThreemaToolbarActivity implements
 										prepareComposeIntent(new ArrayList<>(Collections.singletonList(contactModel)), false);
 									}
 								}
+							} else {
+								// redirect to chat
+								MessageReceiver messageReceiver = IntentDataUtil.getMessageReceiverFromExtras(intent.getExtras(), contactService, groupService, distributionListService);
+								if (messageReceiver != null) {
+									Intent composeIntent = IntentDataUtil.getComposeIntentForReceivers(this, new ArrayList<>(Collections.singletonList(messageReceiver)));
+									startComposeActivity(composeIntent);
+								}
+								return;
 							}
 						}
 					}

+ 1 - 1
app/src/main/java/ch/threema/app/activities/SMSVerificationLinkActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/SendMediaActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ServerMessageActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/SimpleWebViewActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/StickerSelectorActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2016-2021 Threema GmbH
+ * Copyright (c) 2016-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/StopPassphraseServiceActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/StorageManagementActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2015-2021 Threema GmbH
+ * Copyright (c) 2015-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/SupportActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/TextChatBubbleActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2020-2021 Threema GmbH
+ * Copyright (c) 2020-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ThreemaActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ThreemaAppCompatActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2018-2021 Threema GmbH
+ * Copyright (c) 2018-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/ThreemaToolbarActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2014-2021 Threema GmbH
+ * Copyright (c) 2014-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

+ 1 - 1
app/src/main/java/ch/threema/app/activities/UnlockMasterKeyActivity.java

@@ -4,7 +4,7 @@
  *   |_| |_||_|_| \___\___|_|_|_\__,_(_)
  *
  * Threema for Android
- * Copyright (c) 2013-2021 Threema GmbH
+ * Copyright (c) 2013-2022 Threema GmbH
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License, version 3,

Vissa filer visades inte eftersom för många filer har ändrats