浏览代码

Version 5.6.2

Threema 11 月之前
父节点
当前提交
bdc65f240b

+ 2 - 2
app/build.gradle

@@ -18,14 +18,14 @@ if (getGradle().getStartParameter().getTaskRequests().toString().contains("Hms")
 // version codes
 
 // Only use the scheme "<major>.<minor>.<patch>" for the app_version
-def app_version = "5.6.1"
+def app_version = "5.6.2"
 
 // beta_suffix with leading dash (e.g. `-beta1`)
 // should be one of (alpha|beta|rc) and an increasing number or empty for a regular release.
 // Note: in nightly builds this will be overwritten with a nightly version "-n12345"
 def beta_suffix = ""
 
-def defaultVersionCode = 1013
+def defaultVersionCode = 1014
 
 /**
  * Return the git hash, if git is installed.

+ 1 - 2
app/src/libre/play/release-notes/de/default.txt

@@ -1,2 +1 @@
-* Verbesserung bei der Verwendung von «dynamischen Farben»
-* Behebung eines Fehlers, dass auch bei aktivem «Bitte nicht stören» eine Benachrichtigung mit Vibration ausgelöst wurde
+- Behebung eines Fehlers des Updaters der Shop Version

+ 1 - 2
app/src/libre/play/release-notes/en-US/default.txt

@@ -1,2 +1 @@
-* Improvements when “dynamic colors” are used
-* Fix of a bug, that could cause a vibrating notification even if “Do not disturb” is active
+- Fixed a bug in relation to the automatic updates of the threema shop version

+ 11 - 13
app/src/main/java/ch/threema/app/dialogs/WizardSafeSearchPhoneDialog.java

@@ -35,9 +35,11 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
 
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
+import java.util.Optional;
 
 import androidx.appcompat.app.AppCompatDialog;
 import androidx.fragment.app.DialogFragment;
+import androidx.fragment.app.Fragment;
 import ch.threema.app.R;
 import ch.threema.app.ThreemaApplication;
 import ch.threema.app.services.LocaleService;
@@ -158,15 +160,15 @@ public class WizardSafeSearchPhoneDialog extends DialogFragment implements Selec
 	}
 
 	private static class SearchIdTask extends AsyncTask<String, Void, ArrayList<String>> {
-		private WeakReference<WizardSafeSearchPhoneDialog> contextReference;
+		private final WeakReference<WizardSafeSearchPhoneDialog> dialogReference;
 
-		SearchIdTask(WizardSafeSearchPhoneDialog context) {
-			contextReference = new WeakReference<>(context);
+		SearchIdTask(WizardSafeSearchPhoneDialog dialog) {
+			dialogReference = new WeakReference<>(dialog);
 		}
 
 		@Override
 		protected void onPreExecute() {
-			WizardSafeSearchPhoneDialog dialog = contextReference.get();
+			WizardSafeSearchPhoneDialog dialog = dialogReference.get();
 			if (dialog == null || dialog.isRemoving() || dialog.isDetached()) return;
 
 			GenericProgressDialog.newInstance(R.string.safe_id_lookup, R.string.please_wait).show(dialog.getFragmentManager(), DIALOG_TAG_PROGRESS);
@@ -174,12 +176,12 @@ public class WizardSafeSearchPhoneDialog extends DialogFragment implements Selec
 
 		@Override
 		protected ArrayList<String> doInBackground(String... params) {
-			return contextReference.get().threemaSafeService.searchID(params[0], params[1]);
+			return dialogReference.get().threemaSafeService.searchID(params[0], params[1]);
 		}
 
 		@Override
 		protected void onPostExecute(ArrayList<String> ids) {
-			final WizardSafeSearchPhoneDialog dialog = contextReference.get();
+			final WizardSafeSearchPhoneDialog dialog = dialogReference.get();
 			if (dialog == null || dialog.isRemoving() || dialog.isDetached()) return;
 
 			DialogUtil.dismissDialog(dialog.getFragmentManager(), DIALOG_TAG_PROGRESS, true);
@@ -200,7 +202,9 @@ public class WizardSafeSearchPhoneDialog extends DialogFragment implements Selec
 					selectorDialog.show(dialog.getFragmentManager(), DIALOG_TAG_SELECT_ID);
 				}
 			} else {
-				Toast.makeText(dialog.getActivity(), R.string.safe_no_id_found, Toast.LENGTH_LONG).show();
+                Optional.ofNullable(dialog)
+                    .map(Fragment::getActivity)
+                    .ifPresent(activity -> Toast.makeText(activity, R.string.safe_no_id_found, Toast.LENGTH_LONG).show());
 			}
 		}
 	}
@@ -214,10 +218,4 @@ public class WizardSafeSearchPhoneDialog extends DialogFragment implements Selec
 		callback.onYes(getTag(), matchingIDs.get(which).getText());
 		dismiss();
 	}
-
-	@Override
-	public void onCancel(String tag) {}
-
-	@Override
-	public void onNo(String tag) {}
 }

+ 11 - 3
app/src/main/java/ch/threema/app/voip/VoipAudioManager.java

@@ -46,6 +46,7 @@ import java.util.concurrent.ExecutionException;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
 import ch.threema.app.ThreemaApplication;
 import ch.threema.app.managers.ListenerManager;
 import ch.threema.app.notifications.BackgroundErrorNotification;
@@ -85,7 +86,7 @@ public class VoipAudioManager {
 
 	// Default audio device; speaker phone for devices without telephony features
 	// (e.g. tablets) or earpiece for devices with telephony features.
-	private AudioDevice defaultAudioDevice;
+	private final AudioDevice defaultAudioDevice;
 
 	// Contains the currently selected audio device.
 	// This device is changed automatically using a certain scheme where e.g.
@@ -106,7 +107,7 @@ public class VoipAudioManager {
 	@NonNull private HashSet<AudioDevice> audioDevices = new HashSet<>();
 
 	// Broadcast receiver for wired headset intent broadcasts.
-	private BroadcastReceiver wiredHeadsetReceiver;
+	private final BroadcastReceiver wiredHeadsetReceiver;
 
 	// Callback method for changes in audio focus.
 	private AudioManager.OnAudioFocusChangeListener audioFocusChangeListener;
@@ -430,7 +431,14 @@ public class VoipAudioManager {
 	 * Helper method for receiver registration.
 	 */
 	private void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
-		apprtcContext.registerReceiver(receiver, filter);
+        ContextCompat.registerReceiver(
+            apprtcContext,
+            receiver,
+            filter,
+            // Note that for some system broadcasts like this one, the receiver does not need to be
+            // exported.
+            ContextCompat.RECEIVER_NOT_EXPORTED
+        );
 	}
 
 	/**

+ 6 - 1
app/src/main/java/ch/threema/app/voip/VoipBluetoothManager.java

@@ -583,7 +583,12 @@ public class VoipBluetoothManager {
 	}
 
 	protected void registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
-		apprtcContext.registerReceiver(receiver, filter);
+        ContextCompat.registerReceiver(
+            apprtcContext,
+            receiver,
+            filter,
+            ContextCompat.RECEIVER_EXPORTED
+        );
 	}
 
 	protected void unregisterReceiver(BroadcastReceiver receiver) {

+ 13 - 5
app/src/main/java/ch/threema/app/webclient/services/BatteryStatusServiceImpl.java

@@ -36,6 +36,7 @@ import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.WorkerThread;
 
+import androidx.core.content.ContextCompat;
 import ch.threema.app.utils.BatteryStatusUtil;
 import ch.threema.app.webclient.manager.WebClientListenerManager;
 import ch.threema.base.utils.LoggingUtil;
@@ -95,7 +96,7 @@ public class BatteryStatusServiceImpl implements BatteryStatusService {
 	 * Subscribe to the battery status broadcast.
 	 */
 	public void acquire(WebClientSessionModel session) {
-		logger.debug("Acquire webclient battery status subscription for session " + session.getId());
+		logger.debug("Acquire webclient battery status subscription for session {}", session.getId());
 		if (!this.acquiredSessionIds.contains(session.getId())) {
 			this.acquiredSessionIds.add(session.getId());
 		}
@@ -106,7 +107,7 @@ public class BatteryStatusServiceImpl implements BatteryStatusService {
 	 * Unsubscribe from the battery status broadcast.
 	 */
 	public void release(WebClientSessionModel session) {
-		logger.debug("Release webclient battery status subscription for session " + session.getId());
+		logger.debug("Release webclient battery status subscription for session {}", session.getId());
 		if (this.acquiredSessionIds.contains(session.getId())) {
 			this.acquiredSessionIds.remove((Integer)session.getId());
 		}
@@ -114,12 +115,19 @@ public class BatteryStatusServiceImpl implements BatteryStatusService {
 	}
 
 	private void execute() {
-		if (this.acquiredSessionIds.size() > 0) {
+		if (!this.acquiredSessionIds.isEmpty()) {
 			if (this.subscribed) {
 				logger.debug("Already subscribed");
 			} else {
-				this.appContext.registerReceiver(this.batteryStatusReceiver, getBatteryStatusIntentFilter());
-				this.subscribed = true;
+                ContextCompat.registerReceiver(
+                    this.appContext,
+                    this.batteryStatusReceiver,
+                    getBatteryStatusIntentFilter(),
+                    // Note that for some system broadcasts like this one, the receiver does not
+                    // need to be exported.
+                    ContextCompat.RECEIVER_NOT_EXPORTED
+                );
+                this.subscribed = true;
 				logger.debug("Subscribed");
 			}
 		} else {

+ 1 - 0
app/src/main/res/values-fr/strings.xml

@@ -334,6 +334,7 @@
     <string name="synchronize_contact">Synchronisation du carnet d\'adresses</string>
     <string name="exclude_contact">Exclure de la synchro automatique</string>
     <string name="prefs_header_lists">Listes</string>
+    <string name="prefs_title_blocked_contacts">Contacts bloqués</string>
     <string name="prefs_sum_blocked_contacts">Les messages des ID indiqués ici seront ignorés.</string>
     <string name="verified">Vérifié</string>
     <string name="want_to_add_to_exclude_list">Ce contact est lié à une entrée dans votre carnet d\'adresses. Si vous le supprimez dans Threema, il réapparaîtra après une synchro des contacts.\nVoulez-vous l\'exclure de la synchronisation ?</string>

+ 1 - 0
app/src/main/res/values-nl-rNL/strings.xml

@@ -335,6 +335,7 @@
     <string name="synchronize_contact">Adresboek synchroniseren</string>
     <string name="exclude_contact">Uitsluiten van automatisch synchroniseren</string>
     <string name="prefs_header_lists">Lijsten</string>
+    <string name="prefs_title_blocked_contacts">Geblokkeerde contacten</string>
     <string name="prefs_sum_blocked_contacts">Berichten van hier weergegeven ID\'s worden genegeerd.</string>
     <string name="verified">Geverifieerd</string>
     <string name="want_to_add_to_exclude_list">Deze contactpersoon is gekoppeld aan een artikel in het adresboek van uw telefoon. Als u hem/haar in Threema verwijderd, verschijnt het opnieuw na een synchronisatie.\nWilt u de contactpersoon uitsluiten van synchronisatie?</string>

+ 1 - 0
app/src/main/res/values-pl/strings.xml

@@ -335,6 +335,7 @@
     <string name="synchronize_contact">Synchron. książki adresów</string>
     <string name="exclude_contact">Wyłącz z synchronizacji audio</string>
     <string name="prefs_header_lists">Listy</string>
+    <string name="prefs_title_blocked_contacts">Zablokowane kontakty</string>
     <string name="prefs_sum_blocked_contacts">Wiadomości od identyfikatorów wypisanych tutaj będą ignorowane.</string>
     <string name="verified">Zweryfikowane</string>
     <string name="want_to_add_to_exclude_list">Ten kontakt jest powiązany z rekordem w Twojej telefonicznej książce adresowej. Jeżeli go skasujesz w Threemie, pojawi się ponownie po synchronizacji kontaktów.\nCzy chciałbyś wykluczyć go z synchronizacji?</string>

+ 1 - 0
app/src/main/res/values-pt-rBR/strings.xml

@@ -334,6 +334,7 @@
     <string name="synchronize_contact">Sincronizar endereços</string>
     <string name="exclude_contact">Excluir da sincronização automática</string>
     <string name="prefs_header_lists">Listas</string>
+    <string name="prefs_title_blocked_contacts">Contatos bloqueados</string>
     <string name="prefs_sum_blocked_contacts">As mensagens das IDs listadas aqui serão ignoradas.</string>
     <string name="verified">Confirmado(s)</string>
     <string name="want_to_add_to_exclude_list">Este contato do Threema está vinculado a um contato do seu celular. Se você apagá-lo no Threema, ele irá reaparecer depois de uma sincronização de contatos.\nGostaria de excluí-lo da sincronização?</string>

+ 1 - 1
app/src/main/res/values-ru/strings.xml

@@ -335,7 +335,7 @@
     <string name="exclude_contact">Исключить из автосинхронизации</string>
     <string name="prefs_header_lists">Списки</string>
     <string name="prefs_title_blocked_contacts">Заблокированные контакты</string>
-    <string name="prefs_sum_blocked_contacts">Сообщения от контактов с перечисленными здесь ID будут игнорироваться.</string>
+    <string name="prefs_sum_blocked_contacts">Сообщения от контактов с перечисленными здесь ID будут игнорироваться</string>
     <string name="verified">Проверено</string>
     <string name="want_to_add_to_exclude_list">Этот контакт связан с записью в телефонной книге вашего устройства. Если вы удалите его в Threema, он появится снова после синхронизации контактов.\nИсключить его из синхронизации?</string>
     <string name="no">Нет</string>

+ 1 - 0
app/src/main/res/values-sk/strings.xml

@@ -337,6 +337,7 @@ alebo naskenovať QR kód pomocou iného zariadenia.</string>
     <string name="synchronize_contact">Synchronizácia kontaktov</string>
     <string name="exclude_contact">Vyňať z automatickej synchronizácie</string>
     <string name="prefs_header_lists">Zoznamy</string>
+    <string name="prefs_title_blocked_contacts">Blokované kontakty</string>
     <string name="prefs_sum_blocked_contacts">Správy od tu uvedených ID budú ignorované.</string>
     <string name="verified">Overené</string>
     <string name="want_to_add_to_exclude_list">Tento kontakt je prepojený s adresárom telefónu. Ak ho zmažete, v aplikácii Threema sa objaví znovu po synchronizácii kontaktov.\nChcete ho vylúčiť zo synchronizácie?</string>

+ 2 - 1
app/src/main/res/values-tr/strings.xml

@@ -335,7 +335,8 @@ tekrar denemeden önce girdiğiniz numaranın doğru olduğundan ve mobil ağa b
     <string name="synchronize_contact">Adres defteri eşitlemesi</string>
     <string name="exclude_contact">Otomatik eşitlemeden hariç tut</string>
     <string name="prefs_header_lists">Listeler</string>
-    <string name="prefs_sum_blocked_contacts">Burada listelenen kimliklerden gelen mesajlar yoksayılacak.</string>
+    <string name="prefs_title_blocked_contacts">Engellenmiş kişi</string>
+    <string name="prefs_sum_blocked_contacts">Burada listelenen kimliklerden gelen mesajlar yok sayılacak.</string>
     <string name="verified">Doğrulandı</string>
     <string name="want_to_add_to_exclude_list">Bu kişi, telefonunuzun adres defterindeki bir kayda bağlıdır. Eğer  uygulamadan silerseniz, eşitlemeden sonra yeniden görünüyor olacaktır. Eşitlemeden hariç tutmak ister misiniz?</string>
     <string name="no">Hayır</string>

+ 1 - 0
app/src/main/res/values-zh-rCN/strings.xml

@@ -345,6 +345,7 @@
     <string name="synchronize_contact">通讯录同步</string>
     <string name="exclude_contact">排除自动同步</string>
     <string name="prefs_header_lists">清单</string>
+    <string name="prefs_title_blocked_contacts">被屏蔽的联系人</string>
     <string name="prefs_sum_blocked_contacts">来自这里列出的ID的消息将被忽略。</string>
     <string name="verified">已验证</string>
     <string name="want_to_add_to_exclude_list">此联系人已链接到手机通讯录中的记录。如果您

+ 2 - 1
app/src/main/res/values-zh-rTW/strings.xml

@@ -245,7 +245,7 @@
     <string name="emoji_recent">常用項目</string>
     <string name="emoji_smileys">表情符號</string>
     <string name="emoji_people">人物</string>
-    <string name="emoji_nature">野生物</string>
+    <string name="emoji_nature">野生物</string>
     <string name="emoji_food">食物飲料</string>
     <string name="emoji_travel">旅行與地點</string>
     <string name="emoji_activity">活動</string>
@@ -345,6 +345,7 @@
     <string name="synchronize_contact">通訊錄同步</string>
     <string name="exclude_contact">排除自動同步</string>
     <string name="prefs_header_lists">清單</string>
+    <string name="prefs_title_blocked_contacts">被封鎖的聯絡人</string>
     <string name="prefs_sum_blocked_contacts">來自這裡列出的ID的訊息將被忽略。</string>
     <string name="verified">已驗證</string>
     <string name="want_to_add_to_exclude_list">此聯絡人已連結至電話通訊錄中的記錄。如果您

+ 8 - 2
app/src/store_threema/java/ch/threema/app/activities/DownloadApkActivity.java

@@ -53,6 +53,7 @@ import androidx.activity.result.ActivityResultLauncher;
 import androidx.activity.result.contract.ActivityResultContracts;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.core.content.ContextCompat;
 import ch.threema.app.R;
 import ch.threema.app.ThreemaApplication;
 import ch.threema.app.dialogs.GenericAlertDialog;
@@ -214,8 +215,13 @@ public class DownloadApkActivity extends ThreemaActivity implements GenericAlert
 			dialog.setData(downloadUrl = IntentDataUtil.getUrl(intent));
 			getSupportFragmentManager().beginTransaction().add(dialog, DIALOG_TAG_DOWNLOAD_UPDATE).commitAllowingStateLoss();
 
-			this.registerReceiver(this.downloadApkFinishedReceiver, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
-		} else {
+            ContextCompat.registerReceiver(
+                this,
+                this.downloadApkFinishedReceiver,
+                new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE),
+                ContextCompat.RECEIVER_EXPORTED
+            );
+        } else {
 			finish();
 		}
 	}