briar issueshttps://code.briarproject.org/briar/briar/-/issues2022-05-11T14:23:37Zhttps://code.briarproject.org/briar/briar/-/issues/2312Briar fails to start if clock was unreasonably wrong on first run2022-05-11T14:23:37ZakwizgranBriar fails to start if clock was unreasonably wrong on first runSteps to reproduce:
* If a Briar account exists, delete it
* Set the system clock to a date before 1 Jan 2021
* Launch Briar and create an account
* Briar will show the startup failure screen due to the clock being wrong
* Set the system...Steps to reproduce:
* If a Briar account exists, delete it
* Set the system clock to a date before 1 Jan 2021
* Launch Briar and create an account
* Briar will show the startup failure screen due to the clock being wrong
* Set the system clock to the right date
* Launch Briar again
* The password screen will be shown
* Enter the password
* Briar will show the startup failure screen, saying the database is corrupt
Log snippet from the second run (after correcting the clock):
```
2022-04-27 08:54:55.872 22506-22542/org.briarproject.briar.android.debug I/H2Database: Contents of account directory before opening DB:
2022-04-27 08:54:55.872 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug 4096
2022-04-27 08:54:55.872 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug/lib 4096
2022-04-27 08:54:55.882 22506-22542/org.briarproject.briar.android.debug I/H2Database: F /data/data/org.briarproject.briar.android.debug/lib/libobfs4proxy.so 6481961
2022-04-27 08:54:55.882 22506-22542/org.briarproject.briar.android.debug I/H2Database: F /data/data/org.briarproject.briar.android.debug/lib/libtor.so 5957620
2022-04-27 08:54:55.882 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug/cache 4096
2022-04-27 08:54:55.882 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug/cache/com.android.renderscript.cache 4096
2022-04-27 08:54:55.882 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug/shared_prefs 4096
2022-04-27 08:54:55.892 22506-22542/org.briarproject.briar.android.debug I/H2Database: F /data/data/org.briarproject.briar.android.debug/shared_prefs/org.briarproject.briar.android.debug_preferences.xml 115
2022-04-27 08:54:55.892 22506-22542/org.briarproject.briar.android.debug I/H2Database: F /data/data/org.briarproject.briar.android.debug/shared_prefs/_has_set_default_values.xml 126
2022-04-27 08:54:55.892 22506-22542/org.briarproject.briar.android.debug I/H2Database: F /data/data/org.briarproject.briar.android.debug/shared_prefs/db.xml 65
2022-04-27 08:54:55.892 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug/app_key 4096
2022-04-27 08:54:55.892 22506-22542/org.briarproject.briar.android.debug I/H2Database: F /data/data/org.briarproject.briar.android.debug/app_key/db.key.bak 218
2022-04-27 08:54:55.892 22506-22542/org.briarproject.briar.android.debug I/H2Database: F /data/data/org.briarproject.briar.android.debug/app_key/db.key 218
2022-04-27 08:54:55.902 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug/app_db 4096
2022-04-27 08:54:55.902 22506-22542/org.briarproject.briar.android.debug I/H2Database: D /data/data/org.briarproject.briar.android.debug/app_tor 4096
2022-04-27 08:54:55.902 22506-22542/org.briarproject.briar.android.debug I/H2Database: Reopening DB: false
```
Stacktrace:
```
2022-04-27 08:55:00.046 22506-22542/org.briarproject.briar.android.debug W/LifecycleManagerImpl: org.briarproject.bramble.api.db.DbException
org.briarproject.bramble.api.db.DbException
at org.briarproject.bramble.identity.IdentityManagerImpl.loadIdentityWithKeyPair(IdentityManagerImpl.java:159)
at org.briarproject.bramble.identity.IdentityManagerImpl.getCachedIdentity(IdentityManagerImpl.java:147)
at org.briarproject.bramble.identity.IdentityManagerImpl.onDatabaseOpened(IdentityManagerImpl.java:95)
at org.briarproject.bramble.lifecycle.LifecycleManagerImpl.lambda$startServices$0(LifecycleManagerImpl.java:129)
at org.briarproject.bramble.lifecycle.LifecycleManagerImpl.$r8$lambda$R30tTgoiROvN8ROsUbPogFK9rjY(LifecycleManagerImpl.java)
at org.briarproject.bramble.lifecycle.LifecycleManagerImpl$$ExternalSyntheticLambda0.run(Unknown Source)
at org.briarproject.bramble.db.DatabaseComponentImpl.transaction(DatabaseComponentImpl.java:200)
at org.briarproject.bramble.lifecycle.LifecycleManagerImpl.startServices(LifecycleManagerImpl.java:123)
at org.briarproject.briar.android.BriarService.lambda$onCreate$0(BriarService.java:141)
at org.briarproject.briar.android.BriarService.$r8$lambda$HDU85pNkqbcIvjlH9WM8JDDv2bo(BriarService.java)
at org.briarproject.briar.android.BriarService$$ExternalSyntheticLambda5.run(Unknown Source)
at org.briarproject.bramble.system.AndroidWakeLockManagerImpl.lambda$executeWakefully$1(AndroidWakeLockManagerImpl.java:95)
at org.briarproject.bramble.system.AndroidWakeLockManagerImpl.$r8$lambda$HU3N-m0ADiLNH1gKAKkCiyTw2fM(AndroidWakeLockManagerImpl.java)
at org.briarproject.bramble.system.AndroidWakeLockManagerImpl$$ExternalSyntheticLambda0.run(Unknown Source)
at java.lang.Thread.run(Thread.java:856)
```
It looks like the DB key was saved on the first run but the DB wasn't created. On the second run we assumed an identity had already been created so we didn't store one, and then we got an exception when trying to load an identity from the newly created DB.Android 1.4https://code.briarproject.org/briar/briar/-/issues/2307Connections to Tor v3 hidden services fail repeatedly after about 1 second2023-03-15T12:45:52ZakwizgranConnections to Tor v3 hidden services fail repeatedly after about 1 secondConnections to Tor v3 hidden services sometimes fail repeatedly with `java.io.IOException: Connection failed: Host unreachable` after about 1 second, despite the remote peer being online.
To reproduce this, it's helpful to prevent the r...Connections to Tor v3 hidden services sometimes fail repeatedly with `java.io.IOException: Connection failed: Host unreachable` after about 1 second, despite the remote peer being online.
To reproduce this, it's helpful to prevent the remote peer from making outgoing connections (eg change the check at the top of TorPlugin#createConnection() from `if (getState() != ACTIVE) return null` to `if(getState() != ACTIVE || true) return null` for the remote peer only). This ensures that the local peer won't receive any incoming connections that would prevent it from polling.
Next, start both peers and wait for the local peer to connect to the remote peer. Disable Tor on the remote peer, wait for the local peer to notice that the connection has been lost, then re-enable Tor on the remote peer. The local peer's subsequent connection attempts will continue to fail after about 1 second each for about the next 2 minutes, despite the remote peer being online.
I wonder if Tor is storing some kind of internal state related to previous connection failures that causes subsequent connection attempts to fail early. This may be deliberate (eg avoiding frequent HS descriptor lookups or rendezvous attempts for the same hidden service). Still, it causes Briar to take longer than necessary to reconnect to a contact who has been offline.
Alternatively, perhaps the remote peer isn't reconnecting quickly to its introduction points after coming back online.https://code.briarproject.org/briar/briar/-/issues/2304adding contact issues2022-04-14T23:02:29ZJeremie Lariviereadding contact issuesI am trying to add a contact. We're both online, but Briar on both says the other is offline. One is running 1.4.5 from F-Droid, the other installed 1.4.6 from ApkPure.I am trying to add a contact. We're both online, but Briar on both says the other is offline. One is running 1.4.5 from F-Droid, the other installed 1.4.6 from ApkPure.https://code.briarproject.org/briar/briar/-/issues/2303Power management setup doesn't work on some Huawei devices2022-04-14T11:53:29ZakwizgranPower management setup doesn't work on some Huawei devicesSome Huawei devices running Android 10 throw a SecurityException when we try to open the App Launch settings (#2270).
!1602 fixed the crash by catching the exception, but we need to update the UI so that it shows instructions for openin...Some Huawei devices running Android 10 throw a SecurityException when we try to open the App Launch settings (#2270).
!1602 fixed the crash by catching the exception, but we need to update the UI so that it shows instructions for opening the App Launch settings manually.
These instructions will involve several steps and may be hard for users to follow. Unfortunately this means on affected Huawei devices, users are unlikely to succeed in protecting Briar from being killed.
Affected devices:
* Huawei P40 Pro without Google apps
* Huawei P30 Pro
* Huawei Mate 20 X
* Huawei Mate 20
Not affected:
* Huawei Y6P
* Honor 8Ahttps://code.briarproject.org/briar/briar/-/issues/2300Show more information about startup failures2022-04-08T12:33:12ZakwizgranShow more information about startup failuresRecently we've had several reports of corrupt databases (StartResult#DB_ERROR). Because these errors prevent the app from starting, we can't use crash reports or user feedback to learn about the cause.
We should expose more information ...Recently we've had several reports of corrupt databases (StartResult#DB_ERROR). Because these errors prevent the app from starting, we can't use crash reports or user feedback to learn about the cause.
We should expose more information about startup failures in the UI. This will involve returning the information from LifecycleManager#startService() and then attaching it to the intent that launches StartupFailureActivity. StartupFailureActivity should allow the user to copy the information so they can send it to us.Android 1.4https://code.briarproject.org/briar/briar/-/issues/2288Check whether Tor complains about absence of ec_nistp_64_gcc_128 optimisation...2022-03-18T14:56:41ZakwizgranCheck whether Tor complains about absence of ec_nistp_64_gcc_128 optimisation on Android x86_64On Windows and Linux x64_64, Tor complains if the `ec_nistp_64_gcc_128` optimisation wasn't enabled at compile time. Check whether this also needs to be enabled on Android x86_64.On Windows and Linux x64_64, Tor complains if the `ec_nistp_64_gcc_128` optimisation wasn't enabled at compile time. Check whether this also needs to be enabled on Android x86_64.https://code.briarproject.org/briar/briar/-/issues/2287Scrub path to Tor config file2022-06-20T17:10:53ZakwizgranScrub path to Tor config fileWhen Tor starts it prints the path to the config file, which we log. On Android this path doesn't contain any sensitive information, but on Desktop it might (eg usernames). We should scrub that line before logging it.When Tor starts it prints the path to the config file, which we log. On Android this path doesn't contain any sensitive information, but on Desktop it might (eg usernames). We should scrub that line before logging it.https://code.briarproject.org/briar/briar/-/issues/2283Add menu item to select custom tor bridge2022-08-17T05:41:15ZJohan SchmurgeAdd menu item to select custom tor bridgeAdd menu item to select custom tor bridge. In some countries public tor bridges are blocked, and app does not work. Using custom bridges resolve this problem as it do in tor browser.Add menu item to select custom tor bridge. In some countries public tor bridges are blocked, and app does not work. Using custom bridges resolve this problem as it do in tor browser.https://code.briarproject.org/briar/briar/-/issues/2282iOS feasibility study2022-03-03T17:03:06ZakwizgraniOS feasibility studyTo know whether Briar can be viable on iOS we need to answer the following questions.
Online:
* Can the app run a Tor hidden service on iOS? (Bearing in mind that this requires a wake lock on Android to prevent Tor's circuits from timin...To know whether Briar can be viable on iOS we need to answer the following questions.
Online:
* Can the app run a Tor hidden service on iOS? (Bearing in mind that this requires a wake lock on Android to prevent Tor's circuits from timing out when the CPU sleeps.)
* Can the hidden service keep running for a limited time when the app goes into the background?
* Can the app wake periodically while running in the background, connect to a mailbox via Tor and check for messages?
* If the app finds messages when checking the mailbox, can it (a) store the messages in the local database, (b) show a notification?
Offline:
* Can the app advertise a UUID/other info via BLE such that nearby iOS/Android devices can discover it?
* Can the app scan for UUIDs/other info advertised via BLE by nearby iOS/Android devices?
* Can the app make/receive GATT connections to/from iOS/Android devices?
* Can the app make/receive L2CAP-CoC connections to/from iOS/Android devices?
* Can the app provide a wifi hotspot (without internet access)? Can it make/receive TCP connections to/from devices connected to the hotspot?
* Can the app connect to a wifi hotspot (without internet access) provided by another device? Can it make/receive TCP connections to/from other devices connected to the hotspot?
For all of the above we need to know:
* Differences between foreground and background behaviour
* API limits such as rate limits, number of UUIDs that can be scanned for
* Any other circumstances that could affect the behaviour, such as screen being off, low battery, device reboot, user not bringing the app to the foreground for a long time
* Whether user interaction is neededhttps://code.briarproject.org/briar/briar/-/issues/2281IllegalArgumentException when resuming NavDrawerActivity2023-03-13T13:50:06ZakwizgranIllegalArgumentException when resuming NavDrawerActivity* Android version: 8.1.0
* Phone model: Meizu 16th (meizu_16th_CN)
* Briar version: 1.4.5 (4df523a)
Edited log:
```
03-02 16:07:06.639 I/PluginViewModel: TransportStateEvent: org.briarproject.bramble.tor is ACTIVE
03-02 16:07:11.736 I/A...* Android version: 8.1.0
* Phone model: Meizu 16th (meizu_16th_CN)
* Briar version: 1.4.5 (4df523a)
Edited log:
```
03-02 16:07:06.639 I/PluginViewModel: TransportStateEvent: org.briarproject.bramble.tor is ACTIVE
03-02 16:07:11.736 I/AndroidNetworkManager: Received broadcast android.intent.action.SCREEN_OFF
03-02 16:07:12.294 I/AndroidNetworkManager: Received broadcast android.intent.action.SCREEN_ON
3-02 16:07:14.655 I/BaseActivity: Starting NavDrawerActivity
03-02 16:07:14.999 I/BaseActivity: Stopping NavDrawerActivity
03-02 16:07:18.771 I/AndroidNetworkManager: Received broadcast android.intent.action.SCREEN_OFF
03-02 16:07:19.751 I/BaseActivity: Starting NavDrawerActivity
03-02 16:07:19.753 I/BaseActivity: Resuming NavDrawerActivity
03-02 16:07:19.954 I/AndroidNetworkManager: Received broadcast android.intent.action.SCREEN_ON
03-02 16:07:21.559 I/BaseActivity: Pausing NavDrawerActivity
03-02 16:07:22.150 I/BaseActivity: Stopping NavDrawerActivity
03-02 16:07:23.976 I/BaseActivity: Starting NavDrawerActivity
03-02 16:07:23.977 I/BaseActivity: Resuming NavDrawerActivity
```
Stacktrace:
```
java.lang.IllegalArgumentException: View=DecorView@4228967[] not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:488)
at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:383)
at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:101)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3952)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1796)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:192)
at android.app.ActivityThread.main(ActivityThread.java:6842)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
```
This looks like it's most likely a platform bug, so I'm not adding it to the current milestone for the time being.Android 1.4https://code.briarproject.org/briar/briar/-/issues/2279KeyStoreException: Too many operations2022-06-13T15:00:46ZakwizgranKeyStoreException: Too many operations* Android version: 11
* Phone model: Google Pixel 4a (sunfish)
* Briar version: 1.4.1 (6517f3f)
Log:
```
12-07 10:57:20.650 I/BriarApplicationImpl: Created
12-07 10:57:20.673 I/BaseActivity: Creating SplashScreenActivity
12-07 10:57:20....* Android version: 11
* Phone model: Google Pixel 4a (sunfish)
* Briar version: 1.4.1 (6517f3f)
Log:
```
12-07 10:57:20.650 I/BriarApplicationImpl: Created
12-07 10:57:20.673 I/BaseActivity: Creating SplashScreenActivity
12-07 10:57:20.683 I/BaseActivity: Starting SplashScreenActivity
12-07 10:57:20.685 I/BaseActivity: Resuming SplashScreenActivity
12-07 10:57:21.193 I/BaseActivity: Pausing SplashScreenActivity
12-07 10:57:21.206 I/BaseActivity: Creating NavDrawerActivity
12-07 10:57:21.242 I/BaseActivity: Starting NavDrawerActivity
12-07 10:57:21.243 I/BaseActivity: Resuming NavDrawerActivity
12-07 10:57:21.243 I/BriarActivity: Not signed in, launching StartupActivity
12-07 10:57:21.252 I/BaseActivity: Pausing NavDrawerActivity
12-07 10:57:21.259 I/BaseActivity: Creating StartupActivity
12-07 10:57:21.271 I/AccountManagerImpl: Found database key in primary file
12-07 10:57:21.272 I/BaseActivity: Starting StartupActivity
12-07 10:57:21.289 I/BaseActivity: Resuming StartupActivity
12-07 10:57:21.340 I/BaseActivity: Stopping NavDrawerActivity
12-07 10:57:21.758 I/BaseActivity: Stopping SplashScreenActivity
12-07 10:57:21.758 I/BaseActivity: Destroying SplashScreenActivity
12-07 10:57:22.336 I/BaseActivity: Pausing StartupActivity
12-07 10:57:22.918 I/BaseActivity: Stopping StartupActivity
12-07 10:57:25.564 I/BaseActivity: Starting StartupActivity
12-07 10:57:25.565 I/BaseActivity: Resuming StartupActivity
12-07 10:57:26.387 I/AccountManagerImpl: Found database key in primary file
12-07 10:57:27.178 I/AndroidKeyStrengthener: Loaded key from keystore
```
Stacktrace:
```
java.lang.RuntimeException: java.security.InvalidKeyException: Keystore operation failed
at org.briarproject.briar.android.AndroidKeyStrengthener.strengthenKey(AndroidKeyStrengthener.java:101)
at org.briarproject.bramble.crypto.CryptoComponentImpl.decryptWithPassword(CryptoComponentImpl.java:407)
at org.briarproject.bramble.account.AccountManagerImpl.loadAndDecryptDatabaseKey(AccountManagerImpl.java:214)
at org.briarproject.bramble.account.AccountManagerImpl.signIn(AccountManagerImpl.java:200)
at org.briarproject.briar.android.login.StartupViewModel.lambda$validatePassword$0(StartupViewModel.java:112)
at org.briarproject.briar.android.login.StartupViewModel.lambda$validatePassword$0$StartupViewModel(Unknown Source:0)
at org.briarproject.briar.android.login.-$$Lambda$StartupViewModel$5aurY1rQupylNVXCUST5DjfL1L4.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: java.security.InvalidKeyException: Keystore operation failed
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:1378)
at android.security.KeyStore.getInvalidKeyException(KeyStore.java:1388)
at android.security.keystore.KeyStoreCryptoOperationUtils.getInvalidKeyExceptionForInit(KeyStoreCryptoOperationUtils.java:54)
at android.security.keystore.AndroidKeyStoreHmacSpi.ensureKeystoreOperationInitialized(AndroidKeyStoreHmacSpi.java:184)
at android.security.keystore.AndroidKeyStoreHmacSpi.engineInit(AndroidKeyStoreHmacSpi.java:101)
at javax.crypto.Mac.chooseProvider(Mac.java:443)
at javax.crypto.Mac.init(Mac.java:513)
at org.briarproject.briar.android.AndroidKeyStrengthener.strengthenKey(AndroidKeyStrengthener.java:98)
... 9 more
Caused by: android.security.KeyStoreException: Too many operations
at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
... 16 more
```https://code.briarproject.org/briar/briar/-/issues/2278KeyStoreException: Invalid operation handle2022-06-13T15:00:46ZakwizgranKeyStoreException: Invalid operation handle* Android version: 11
* Phone model: Motorola Moto G(9) Power (cebu_retailn)
* Briar version: 1.4.1 (6517f3f)
Log:
```
12-16 06:37:45.374 I/BriarApplicationImpl: Created
12-16 06:37:45.449 I/BaseActivity: Creating SplashScreenActivity
1...* Android version: 11
* Phone model: Motorola Moto G(9) Power (cebu_retailn)
* Briar version: 1.4.1 (6517f3f)
Log:
```
12-16 06:37:45.374 I/BriarApplicationImpl: Created
12-16 06:37:45.449 I/BaseActivity: Creating SplashScreenActivity
12-16 06:37:45.512 I/BaseActivity: Starting SplashScreenActivity
12-16 06:37:45.513 I/BaseActivity: Resuming SplashScreenActivity
12-16 06:37:45.998 I/BaseActivity: Pausing SplashScreenActivity
12-16 06:37:46.057 I/BaseActivity: Creating NavDrawerActivity
12-16 06:37:46.131 I/BaseActivity: Starting NavDrawerActivity
12-16 06:37:46.134 I/BaseActivity: Resuming NavDrawerActivity
12-16 06:37:46.134 I/BriarActivity: Not signed in, launching StartupActivity
12-16 06:37:46.174 I/BaseActivity: Pausing NavDrawerActivity
12-16 06:37:46.193 I/BaseActivity: Creating StartupActivity
12-16 06:37:46.217 I/AccountManagerImpl: Found database key in primary file
12-16 06:37:46.220 I/BaseActivity: Starting StartupActivity
12-16 06:37:46.302 I/BaseActivity: Resuming StartupActivity
12-16 06:37:46.514 I/BaseActivity: Stopping NavDrawerActivity
12-16 06:37:46.913 I/BaseActivity: Stopping SplashScreenActivity
12-16 06:37:46.914 I/BaseActivity: Destroying SplashScreenActivity
12-16 06:37:52.674 I/AccountManagerImpl: Found database key in primary file
12-16 06:37:57.264 I/AndroidKeyStrengthener: Loaded key from keystore
```
Stacktrace:
```
java.security.ProviderException: Keystore operation failed
at android.security.keystore.AndroidKeyStoreHmacSpi.engineDoFinal(AndroidKeyStoreHmacSpi.java:242)
at javax.crypto.Mac.doFinal(Mac.java:667)
at javax.crypto.Mac.doFinal(Mac.java:742)
at org.briarproject.briar.android.AndroidKeyStrengthener.strengthenKey(AndroidKeyStrengthener.java:99)
at org.briarproject.bramble.crypto.CryptoComponentImpl.decryptWithPassword(CryptoComponentImpl.java:407)
at org.briarproject.bramble.account.AccountManagerImpl.loadAndDecryptDatabaseKey(AccountManagerImpl.java:214)
at org.briarproject.bramble.account.AccountManagerImpl.signIn(AccountManagerImpl.java:200)
at org.briarproject.briar.android.login.StartupViewModel.lambda$validatePassword$0(StartupViewModel.java:112)
at org.briarproject.briar.android.login.StartupViewModel.lambda$validatePassword$0$StartupViewModel(Unknown Source:0)
at org.briarproject.briar.android.login.-$$Lambda$StartupViewModel$5aurY1rQupylNVXCUST5DjfL1L4.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: android.security.KeyStoreException: Invalid operation handle
at android.security.KeyStore.getKeyStoreException(KeyStore.java:1301)
at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:176)
at android.security.keystore.AndroidKeyStoreHmacSpi.engineDoFinal(AndroidKeyStoreHmacSpi.java:236)
... 12 more
```https://code.briarproject.org/briar/briar/-/issues/2276IllegalStateException when restoring state of ConversationActivity2024-03-18T17:46:26ZakwizgranIllegalStateException when restoring state of ConversationActivity* Android version: 7.1.2
* Phone model: Samsung I9192I (lineage_serranove3gxx)
* Briar version: 1.4.4 (36670a8)
Edited log:
```
02-17 19:34:09.198 I/BaseActivity: Creating ConversationActivity
02-17 19:34:09.309 I/BaseActivity: Starting...* Android version: 7.1.2
* Phone model: Samsung I9192I (lineage_serranove3gxx)
* Briar version: 1.4.4 (36670a8)
Edited log:
```
02-17 19:34:09.198 I/BaseActivity: Creating ConversationActivity
02-17 19:34:09.309 I/BaseActivity: Starting ConversationActivity
02-17 19:34:09.330 I/BaseActivity: Resuming ConversationActivity
02-17 19:34:09.414 I/ConversationViewModel: PrivateMessageFormat loaded: TEXT_IMAGES_AUTO_DELETE
02-17 19:34:09.424 I/ImageCompressorImpl: Original image size: 600x450
02-17 19:34:09.424 I/ImageCompressorImpl: Scaling attachment by factor of 1
02-17 19:34:09.542 I/ConversationActivity: Eagerly loading text for latest message
02-17 19:34:09.668 I/ImageCompressorImpl: Compressed image to 32254 bytes, quality 50
02-17 19:34:18.123 I/BaseActivity: Pausing ConversationActivity
02-17 19:34:18.178 I/BaseActivity: Stopping ConversationActivity
02-17 19:34:18.226 I/BaseActivity: Destroying ConversationActivity
02-17 19:34:51.495 I/BaseActivity: Creating ConversationActivity
02-17 19:34:51.573 I/ConversationViewModel: PrivateMessageFormat loaded: TEXT_IMAGES_AUTO_DELETE
02-17 19:34:51.591 I/BaseActivity: Starting ConversationActivity
02-17 19:34:51.596 W/AttachmentCreatorImpl: No Task!
02-17 19:34:51.596 W/AttachmentCreatorImpl: No Result!
02-17 19:34:51.596 W/AttachmentCreatorImpl: Uris empty!
```
Stacktrace:
```
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.briarproject.briar.android/org.briarproject.briar.android.conversation.ConversationActivity}: java.lang.IllegalStateException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2684)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2751)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1496)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6186)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Caused by: java.lang.IllegalStateException
at org.briarproject.briar.android.attachment.AttachmentCreatorImpl.getLiveAttachments(AttachmentCreatorImpl.java:107)
at org.briarproject.briar.android.conversation.ConversationViewModel.storeAttachments(ConversationViewModel.java:274)
at org.briarproject.briar.android.view.TextAttachmentController.onNewUris(TextAttachmentController.java:178)
at org.briarproject.briar.android.view.TextAttachmentController.onRestoreInstanceState(TextAttachmentController.java:242)
at org.briarproject.briar.android.view.TextInputView.onRestoreInstanceState(TextInputView.java:86)
at android.view.View.dispatchRestoreInstanceState(View.java:15755)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3231)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3237)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3237)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3237)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3237)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3237)
at android.view.View.restoreHierarchyState(View.java:15733)
at com.android.internal.policy.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2106)
at android.app.Activity.onRestoreInstanceState(Activity.java:1048)
at org.briarproject.briar.android.conversation.ConversationActivity.onRestoreInstanceState(ConversationActivity.java:362)
at android.app.Activity.performRestoreInstanceState(Activity.java:1003)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1175)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2657)
... 9 more
```Android 1.4https://code.briarproject.org/briar/briar/-/issues/2275AssertionError when adding pending contact2022-02-28T15:06:45ZakwizgranAssertionError when adding pending contact* Android version: 5.1.1
* Phone model: Samsung SM-J120H (j1x3gxx)
* Briar version: 1.4.4 (36670a8)
Last lines of log:
```
02-24 09:47:54.504 I/BaseActivity: Pausing AddContactActivity
02-24 09:47:54.545 I/BaseActivity: Creating Pending...* Android version: 5.1.1
* Phone model: Samsung SM-J120H (j1x3gxx)
* Briar version: 1.4.4 (36670a8)
Last lines of log:
```
02-24 09:47:54.504 I/BaseActivity: Pausing AddContactActivity
02-24 09:47:54.545 I/BaseActivity: Creating PendingContactListActivity
```
Stacktrace:
```
java.lang.AssertionError
at org.briarproject.bramble.api.nullsafety.NullSafety.requireNull(NullSafety.java:30)
at org.briarproject.bramble.rendezvous.RendezvousPollerImpl.addPendingContact(RendezvousPollerImpl.java:180)
at org.briarproject.bramble.rendezvous.RendezvousPollerImpl.lambda$addPendingContactAsync$3(RendezvousPollerImpl.java:306)
at org.briarproject.bramble.rendezvous.RendezvousPollerImpl.$r8$lambda$Mi_U1ZCfMDPQHtgr1vajgSuXz0Y(RendezvousPollerImpl.java)
at org.briarproject.bramble.rendezvous.RendezvousPollerImpl$$ExternalSyntheticLambda3.run(Unknown Source)
at org.briarproject.bramble.PoliteExecutor.lambda$execute$0(PoliteExecutor.java:57)
at org.briarproject.bramble.PoliteExecutor.$r8$lambda$wSvuPL6t_HUoaaqCVexrhJX_RSg(PoliteExecutor.java)
at org.briarproject.bramble.PoliteExecutor$$ExternalSyntheticLambda0.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
```Android 1.4https://code.briarproject.org/briar/briar/-/issues/2274BadTokenException from emoji popup2024-03-18T18:00:04ZakwizgranBadTokenException from emoji popup* Android version: 5.1.1
* Phone model: Samsung SM-J200G (j2ltedd)
* Briar version: 1.4.4 (36670a8)
Stacktrace:
```
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?...* Android version: 5.1.1
* Phone model: Samsung SM-J200G (j2ltedd)
* Briar version: 1.4.4 (36670a8)
Stacktrace:
```
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:772)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:298)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
at android.widget.PopupWindow.invokePopup(PopupWindow.java:1185)
at android.widget.PopupWindow.showAtLocation(PopupWindow.java:983)
at android.widget.PopupWindow.showAtLocation(PopupWindow.java:942)
at com.vanniktech.emoji.EmojiPopup.showAtBottom(EmojiPopup.java:248)
at com.vanniktech.emoji.EmojiPopup.onReceiveResult(EmojiPopup.java:257)
at com.vanniktech.emoji.EmojiResultReceiver.onReceiveResult(EmojiResultReceiver.java:26)
at android.os.ResultReceiver$MyRunnable.run(ResultReceiver.java:50)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
```
Log:
```
02-18 04:08:30.169 I/BriarApplicationImpl: Created
02-18 04:08:30.658 I/BaseActivity: Creating CrashReportActivity
02-18 04:08:31.197 I/BaseActivity: Starting CrashReportActivity
02-18 04:08:31.198 I/BaseActivity: Resuming CrashReportActivity
02-18 04:08:31.240 I/BaseActivity: Pausing CrashReportActivity
02-18 04:08:31.246 I/BaseActivity: Stopping CrashReportActivity
02-18 04:08:31.251 I/BaseActivity: Destroying CrashReportActivity
02-18 04:08:31.305 I/BaseActivity: Creating CrashReportActivity
02-18 04:08:31.345 W/LogDecrypterImpl: java.io.FileNotFoundException: /data/data/org.briarproject.briar.android/files/dev-logcat: open failed: ENOENT (No such file or directory)
java.io.FileNotFoundException: /data/data/org.briarproject.briar.android/files/dev-logcat: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:456)
at java.io.FileInputStream.<init>(FileInputStream.java:76)
at org.briarproject.briar.android.logging.LogDecrypterImpl.decryptLogs(LogDecrypterImpl.java:45)
at org.briarproject.briar.android.reporting.ReportViewModel.lambda$init$0(ReportViewModel.java:97)
at org.briarproject.briar.android.reporting.ReportViewModel.$r8$lambda$9TLFESir3FK2Ov67pYo4zJIxFgo(ReportViewModel.java)
at org.briarproject.briar.android.reporting.ReportViewModel$$ExternalSyntheticLambda1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at org.briarproject.briar.android.reporting.ReportViewModel$SingleShotAndroidExecutor.run(ReportViewModel.java:249)
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:442)
at java.io.FileInputStream.<init>(FileInputStream.java:76)
at org.briarproject.briar.android.logging.LogDecrypterImpl.decryptLogs(LogDecrypterImpl.java:45)
at org.briarproject.briar.android.reporting.ReportViewModel.lambda$init$0(ReportViewModel.java:97)
at org.briarproject.briar.android.reporting.ReportViewModel.$r8$lambda$9TLFESir3FK2Ov67pYo4zJIxFgo(ReportViewModel.java)
at org.briarproject.briar.android.reporting.ReportViewModel$$ExternalSyntheticLambda1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at org.briarproject.briar.android.reporting.ReportViewModel$SingleShotAndroidExecutor.run(ReportViewModel.java:249)
```Android 1.4https://code.briarproject.org/briar/briar/-/issues/2271IllegalStateException when setting password2022-04-17T11:49:19ZakwizgranIllegalStateException when setting password* Android version: 9
* Phone models: Huawei Y6 Pro 2019, Honor 8A, Huawei nova 3i
* Briar version: 1.4.4 (Google Play)
Stacktrace:
```
java.lang.IllegalStateException:
at org.briarproject.briar.android.account.SetupViewModel.setPassw...* Android version: 9
* Phone models: Huawei Y6 Pro 2019, Honor 8A, Huawei nova 3i
* Briar version: 1.4.4 (Google Play)
Stacktrace:
```
java.lang.IllegalStateException:
at org.briarproject.briar.android.account.SetupViewModel.setPassword (SetupViewModel.java:84)
at org.briarproject.briar.android.account.SetPasswordFragment.onClick (SetPasswordFragment.java:123)
at android.view.View.performClick (View.java:6659)
at android.view.View.performClickInternal (View.java:6631)
at android.view.View.access$3100 (View.java:790)
at android.view.View$PerformClick.run (View.java:26187)
at android.os.Handler.handleCallback (Handler.java:907)
at android.os.Handler.dispatchMessage (Handler.java:105)
at android.os.Looper.loop (Looper.java:216)
at android.app.ActivityThread.main (ActivityThread.java:7625)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:987)
```Android 1.4https://code.briarproject.org/briar/briar/-/issues/2263Status of Tor plugin is unclear in connections screen2022-02-11T12:35:00ZakwizgranStatus of Tor plugin is unclear in connections screenWhen the "Use mobile data" setting is turned off or the "Connect to the Internet only when charging" setting is turned on, Briar might not connect to the internet even though the parent setting, "Connect to contacts via the Internet", is...When the "Use mobile data" setting is turned off or the "Connect to the Internet only when charging" setting is turned on, Briar might not connect to the internet even though the parent setting, "Connect to contacts via the Internet", is turned on.
In the main settings screen this is hopefully clear because all the settings are shown. But in the connections screen we only show the parent setting and the current status. So it may not be obvious that Briar is offline, or how to change this.https://code.briarproject.org/briar/briar/-/issues/2262Improve warning about being offline when adding a contact remotely2022-02-11T12:16:38ZakwizgranImprove warning about being offline when adding a contact remotelyIf the user adds a contact remotely while Briar is offline (ie not connected to Tor), we don't show any indication that Briar doesn't have an internet connection until the user reaches the pending contact list, and when the warning is sh...If the user adds a contact remotely while Briar is offline (ie not connected to Tor), we don't show any indication that Briar doesn't have an internet connection until the user reaches the pending contact list, and when the warning is shown it doesn't give any guidance about what the user could do to solve the problem.https://code.briarproject.org/briar/briar/-/issues/2260When a user changes their profile picture, this is reflected in forum message...2023-03-15T12:34:51ZIvanaWhen a user changes their profile picture, this is reflected in forum messages, blog messages and private group messages only after the screen is refreshed**Steps to execute**
A user is member of a private group, has reblogged some blog posts and is a member of a forum.
They have the generic profile picture.
User changes their profile picture.
**Expected results:**
New profile picture...**Steps to execute**
A user is member of a private group, has reblogged some blog posts and is a member of a forum.
They have the generic profile picture.
User changes their profile picture.
**Expected results:**
New profile picture is reflected in forum and private group messages as well as reblogged blog posts immediately.
**Actual results:**
Profile picture is updated only after the screen refresh.
Note: this is a known issue, although I was not able to find an existing ticket, so maybe it is known from attermost discussions? Raisiing this ticket so it doesn't get forgotten, but if duplicated, please close.https://code.briarproject.org/briar/briar/-/issues/2255Improve ContactExistsException2023-03-15T13:04:32ZSebastianImprove ContactExistsExceptionWhen Alice adds an existing proper contact again via `briar://` link, we throw a `ContactExistsException` that is used to show warnings to her to warn about a potential attack that might be in progress with one of the contacts trying to ...When Alice adds an existing proper contact again via `briar://` link, we throw a `ContactExistsException` that is used to show warnings to her to warn about a potential attack that might be in progress with one of the contacts trying to discover her contacts or non-contacts. The exception carries the local `AuthorId` as well as the remote `Author` so that a warning message can explain to Alice who the involved contacts are. However it lacks the alias Alice might have given to the existing contact. The result is that only the original self-given name of the contact can be displayed in warnings. I think this might confuse Alice as the contact name displayed in the warning can be different from the name displayed in her contact list and also can be rather ambiguous.
I propose we add the alias to the `ContactExistsException`. Among the three places where this exception gets created, in one place (in `DatabaseComponentImpl#addPendingContact()`) we already have the existing contact retrieved from the db readily available and could set the additional data right away. In the two other places (in `DatabaseComponentImpl#addContact()`), we don't yet have the contact retrieved. Instead we checked `containsIdentity()` and/or `containsContact()` there. I think we could either just retrieve the existing contact additionally there, shouldn't be a huge burden in terms of performance. We could also leave out the `containsContact()` check and just check if the contact retrieved is `!= null`. Maybe we can even leave out the `containsIdentity()` in this case? Either way I think performance shouldn't be an issue.