Commit Graph

159 Commits

Author SHA1 Message Date
adbenitez bace4d4da5 Merge remote-tracking branch 'upstream/main' 2023-10-12 22:46:05 +02:00
B. Petersen 9b9d2e4daa READ_EXTERNAL_STORAGE permission is still needed for <sdk33 2023-10-12 16:45:37 +02:00
adbenitez 9262c1b0cc Merge remote-tracking branch 'upstream/main' 2023-10-06 22:22:13 +02:00
B. Petersen ac1f2ebdd9 rename blocked-contacts-activity
`BlockedAndShareContactsActivity` is no longer used for sharing contacts,
this was always a misleading name
and is done since #2719 by `AttachContactActivity`.
2023-10-05 23:46:23 +02:00
adbenitez efc0d8d657 Merge remote-tracking branch 'upstream/main' 2023-10-05 01:06:40 +02:00
B. Petersen e7f8dbeb91 split off AttachContactActivity from BlockedAndShareContactsActivity 2023-10-05 00:23:17 +02:00
adbenitez 2e46725e07 Merge remote-tracking branch 'upstream/main' 2023-10-03 15:10:01 +02:00
bjoern f18831b196 set targetSdkVersion to 33 (#2649)
* set targetSdkVersion to 33

* api33 requires permission NEARBY_WIFI_DEVICES to access wifi

not sure, if this affects getSystemService(Context.WIFI_SERVICE),
however, we anyway do not ask for permissions here but just try/catch -
if things do not work, we just cannot get the wifi name

(we're not asking for permission as this would require LOCATION in the past -
and that would scare users that just installed Delta Chat
and select "Add Second Devive".
this is the exact reason why NEARBY_WIFI_DEVICES was introduced, btw.
so in case getting the Wifi name does not work on api33,
we can consider asking for a permission - would still be on startup, however)

* update storage permissions in manifest

according to https://developer.android.com/training/data-storage/shared/media#storage-permission

* also update compileSdkVersion

* api33: adapt audio permission request

* api33: adapt gallery permission request

* request correct permissions for the 'photo rail'

* request correct permissions for avatar selection

* api33: storage and audio permission not needed

* add comment wrt 'camera roll'

* add POST_NOTIFICATIONS to the manifest, this already allows to enable notifications in the system settings

* ask for POST_NOTIFICATIONS permission on startup

* explain how to re-enable notifications if initially disabled

* prefer a device message over an alert

* show in settings if notifications are system-disabled
2023-10-03 00:42:20 +02:00
adbenitez b65b535cdc allow to select as app to open .xdc files, remove zhv 2023-07-20 02:27:52 +02:00
adbenitez c944bec0b7 Merge remote-tracking branch 'upstream/master' 2023-06-27 18:33:10 +02:00
Hocuri 6b2516f8be Don't recreate WebxdcActivity when going to dark mode (#2601)
This fixes the problem that if the user sets the device to dark mode while a webxdc is open, it re-loads veeeeery slowly.
2023-06-26 11:10:26 +02:00
adbenitez 6085b7d550 Merge remote-tracking branch 'upstream/master' 2023-05-02 04:57:36 -04:00
Hocuri 0e27d445ee Rework how activities interact when forwarding/sharing (#2549) 2023-05-02 10:34:31 +02:00
adbenitez 95683fa1fd Merge remote-tracking branch 'upstream/master' 2023-05-01 15:11:43 -04:00
link2xt 8e2dd50d89 Upgrade from Gradle 7.5 to Gradle 8.0.2
Upgraded gradle plugin from 7.2.2 to 7.4.2.

Upgraded gradle wrapper with

    ./gradlew wrapper --gradle-version 8.0.2 --gradle-distribution-sha256-sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7

This command updated gradle/wrapper/gradle-wrapper.properties.
Checksum for 8.0.2 is copied from <https://gradle.org/release-checksums/>.

Replaced deprecated "package" attribute with "namespace" in build.gradle.
2023-04-14 13:08:52 +00:00
adbenitez f5e00e5484 Merge remote-tracking branch 'upstream/master' 2023-04-06 08:56:38 -04:00
adbenitez bae052d735 start with light/dark theme depending on system theme 2023-03-27 16:33:00 -04:00
adbenitez afad51e4fa Merge remote-tracking branch 'upstream/master' 2023-03-26 01:39:32 -04:00
bjoern 3cede346f3 add multi-device-setup (#2493)
* add DcBackupProvider add receiveBackup() wrappers

* add 'Add Another Device' item to settings

* add android-ifaddrs

core-rust uses getifaddrs() which is not available on android ndk.
pull in the code from https://github.com/morristech/android-ifaddrs
that provides an implementation.

* add BackupProviderActivity

* make SVG-hack reusable

* add BackupProviderFragment

* prepare scanning backup codes

* Revert "add android-ifaddrs"

This reverts commit 33b1424427620396f282805d37f8e05c67758546.

* more logging

* call receiveBackup() on scanning DC_QR_BACKUP

* Fixup for recvmmsg fallback

* protect BackupProviderActivity by system secret

* show transfer progress as provided form the core; hide qr-code once scanned

* add a permanent notification for the provider

* clarify what we are waiting for

* add a permanent notification for the receiver

* ask before finishing BackupProviderActivity

* it is fine to cancel the abort question by tapping outside the alert

* remove outdated comment from 'keep screen on'

* add and check TRANSFER_MODE

* rename BackupProviderActivity to BackupTransferActivity

* use our base activity

* start/stop IO in base activity

* use BackupTransferActivity also for scanning

* add BackupReceiverFragment

* show detailed transfer progress

* show details instead of percent during preparation, for now

* launch chatlist and remove welcome when transfer is done

* redirect to chatlist automatically after transfer succeeded

* reword

* make log accessible from send and receive activities

* bump version

* show error if backup provider creation fails

* remove unneeded format()

* show some context in the errors alerts, hide QR code sooner

* calculate transfer percentage as specified

* show a 'close' instead of a 'back' button to make visually clear, things are aborted (there is a quesion anyway)

* add option to copy backup-qr-code to clipboard

* remove vague retry statement, core will show a detailed error soon

* warn about QR codes on clipboard getting invalidated

* make basic strings translatable

* add troubleshooting menu item (once help is evolved, it may be a more visible button, may be localized, may be offline)

* rename to backup_transfer_fragment.xml

* add detailed instructions

* move 1,2,3 layout to the .xml

* fix layout

* use text size used elsewhere

* do best effort to show SSID on sending device

* make SSID code reusable for receiver

* adapt to otherwise used font style

* show ssid also for receiver

* minor refactorings

* make qr code subtitle translatable

* tune down 'same network hint' on scanning device

* add progress bar to provider

* add progress bar to receiver

* bump version

* use 'Add Second Device' wording

this seems slightly catchier as "Add Another Device"
and has less "A" esp. in "Add as Another Device" :)

also at least translation to german seems nicer ("Zweitgerät"),
most ppl will use max. two devices, but even if more,
that should still be fine.

this was also the first intuition also by other devs in their mockups,
so we'll give it a try.

* use "Exporting/Preparing/Prepared Account" wording

let's give that a try - "Account" is also widely used,
so that seems to make some sense.
even if not 100% fitting,
it seems better than introducing the new term "Collection".

* refine abort question

* Update res/layout/backup_provider_fragment.xml

Co-authored-by: Hocuri <hocuri@gmx.de>

* Update src/org/thoughtcrime/securesms/qr/BackupProviderFragment.java

Co-authored-by: Hocuri <hocuri@gmx.de>

* Update src/org/thoughtcrime/securesms/qr/BackupReceiverFragment.java

Co-authored-by: Hocuri <hocuri@gmx.de>

* Update src/org/thoughtcrime/securesms/qr/BackupTransferActivity.java

Co-authored-by: Hocuri <hocuri@gmx.de>

* Update src/org/thoughtcrime/securesms/qr/BackupReceiverFragment.java

Co-authored-by: Hocuri <hocuri@gmx.de>

* remove string duplicate

* refine 1,2,3

* simplify string ids

* focus on what matters

---------

Co-authored-by: link2xt <link2xt@testrun.org>
Co-authored-by: Hocuri <hocuri@gmx.de>
2023-03-24 15:22:26 +01:00
adbenitez f04156dc9d Merge remote-tracking branch 'upstream/master' 2023-01-08 14:02:04 -05:00
bjoern fc542dbe7e tweak archive (#2441)
* basic layout of new archive-link, including icon and unread counter

* remove 'archived chats' from main menu

* vertically align elements of new archive-link

* show unread indicator also for archived chats

* show muted unread counter in grey

* use shorter label for the 'Archive' link
2023-01-05 10:37:52 +01:00
adbenitez 860f1b5b02 Merge remote-tracking branch 'upstream/master' 2022-11-01 01:43:50 -04:00
bjoern c28c72511e fix crash in share-to-delta and similar issues (#2411)
* fix crash in share-to-delta

the crash was introduced by 1.34.2 that was released for testing only.

reason is a wrong `exported` flag - it makes sense to have `exported="true"` here.

the flag was added in https://github.com/deltachat/deltachat-android/pull/2407
as needed for android12 - and i was assuming that the old default was `false`
and set that value to all missing ones.

that assumption seems to be wrong, so we should double-check all flags
changed by https://github.com/deltachat/deltachat-android/pull/2407

* set exported=true; this is the pre-android12 default in case there intent-filters
2022-10-31 21:47:47 +01:00
adbenitez 90366eeb46 fix AndroidManifest.xml 2022-10-31 03:29:18 -04:00
adbenitez 48dec04e83 Merge remote-tracking branch 'upstream/master' 2022-10-30 11:58:21 -04:00
bjoern 443ea0cd36 bump targetSdkVersion to 32 (#2407)
* bump targetSdkVersion to 32

* explicitly set `android:exported` for `indent-filter`

this is required since targetSdkVersion 31,
https://developer.android.com/guide/components/intents-filters#Receiving

as the default was `false` before,
i just explicitly set `android:exported="false"` without looking in the details
of each filter.

* update to gradle 7.2.2; this might be needed to get warnings etc.

* update androidx dependencies

at least the update of androidx.sharetarget is required because of the missing
`android:exported`; i took the chance to update all androidx depenencies.

see https://developer.android.com/jetpack/androidx/releases/appcompat
for a CHANGELOG of each dependency.

* use explicit dependency instead of transitive ones; this fixes a weird duplicate error, see https://stackoverflow.com/questions/69817925/problem-duplicate-class-androidx-lifecycle-viewmodel-found-in-modules

* work around google's poor design decision wrt FLAG_MUTABLE

instead of setting a default behavior and logging a warning,
google crashes the application when the flag is missing on newer androids.

and setting the flag for older API seems to be undefined and therefore a lot of
Build.VERSION.SDK_INT >= Build.VERSION_CODES.M would be required each time
a PendingIntent object is constructed ...

our Util returns either the new flag or zero,
so that can just be used unconditionally on construction.

* update dependencies but exoplayer to mitigate issues with FLAG_MUTABLE

exoplayer needs more love and updating opens a can of worms;
i tested, at least in the emulator, video and voice message playback
works as usual, so let's update exoplayer if needed.
2022-10-30 16:06:24 +01:00
adbenitez e663e5e64a Merge remote-tracking branch 'upstream/master' 2022-10-03 23:58:16 -04:00
Simon Laux 05fcac819e add dclogin scheme to qr code scan (#2366)
* add dclogin scheme to qr code scan

* Update src/org/thoughtcrime/securesms/qr/QrCodeHandler.java

Co-authored-by: Asiel Díaz Benítez <asieldbenitez@gmail.com>

* Update src/org/thoughtcrime/securesms/qr/QrCodeHandler.java

Co-authored-by: bjoern <r10s@b44t.com>

* handle DCACCOUNT and DCLOGIN schemes on new intents

* keep existing function name, that is maybe not less confusing, but at least already known

Co-authored-by: bjoern <r10s@b44t.com>
Co-authored-by: Asiel Díaz Benítez <asieldbenitez@gmail.com>
2022-09-29 18:34:01 +02:00
adbenitez d868aa913b Merge remote-tracking branch 'upstream/master' 2022-08-19 23:57:46 -04:00
bjoern 853000f8dc option to add webxdc apps to home screen (#2353)
* add 'Add to Home Screen' menus for webxdc apps

* make adding shortcut basically work

* avoid starting webxdc from foreign accounts

* recreate back stack, if possible

according to
https://developer.android.com/training/notify-user/navigation :
"When you start an activity from a notification,
you must preserve the user's expected navigation experience.
Tapping Back should take the user
back through the app's normal work flow to the Home screen [...]"

same seems to be true for shortcuts using the same class for constructing
the back stack.

the back stack is reconstructed for API 26 (Oreo, 2017) or newer,
for oder API `requestPinShortcut()`
only uses the top-level activity for the shortcut.
working around that is probably possible, but would be quite some effort in an
already complicated area and would result in bugs that are not so easy to see.

also, on these old androids, users are probably used to the no-back-stack
behaviour.

* show a warning if app was deleted

* add 'Add to Home Screen' also to gallery

beside chat- and webxdc-activity,
this is the third place where the webxdc is listed.

as adding may result in dialogs from the launcher,
we allow the option only for a single selected webxdc,
as otherwise a series of dialogs would pop up.

* show 'Done' toast short, this is what we are doing at all the other places when showing 'Done'
2022-08-15 11:30:14 +02:00
adbenitez 03e40491c9 Merge remote-tracking branch 'upstream/master' 2022-05-17 21:12:48 -04:00
B. Petersen a0332f0c4e empty default WebViewActivity title
if not set to empty, it defaults to "Delta Chat",
which results in a short flickering on opening WebViews that set the title
in an async way.
(all WebViewActivity set a "nice" title, so the default is never shown anyway)
2022-05-17 11:15:58 +02:00
adbenitez fafbd94012 Merge remote-tracking branch 'upstream/master' 2022-03-27 11:44:22 -04:00
Hocuri de9100f8e1 fix stuff 2022-03-26 13:01:26 +01:00
adbenitez 4ccc164b86 Merge remote-tracking branch 'upstream/master' 2022-01-18 14:43:40 -05:00
bjoern 9e70aa7cad webxdc (#2174)
* add new w30 APIs

* create the webview,
disable internet access,
inject deltachat.js

* connect deltachat to the webview

* promisify api

* use msgActionButton to start the w30 apps

* cleanup

- create observers in onCreate() to avoid memory leak,
- derive from WebViewActivity to easier deal with particularities
  and to saves >100 loc
- reorder some methods to reflect lifetimes

* make it more clear, which uri-part is 'domain' and which one is 'path'

* unify logging

* it is 'statusUpdate' not 'stateUpdate'; not sure if promise is needed at the end, we can readd that as needed, simple code for now

* use core implementation for status updates

* disable debugging enabled by default, streamline code

* use same name for InternalJSApi for both, js and java

* getStatusUpdates() always return an array

* call JSON.stringify() on payload

* fix typo, fix equal operator

* use shorter function names in js land

* adapt to new zipped w30 format

* load any file from w30 archives

* add fallback if getMimeTypeFromExtension() fails

* rename w30 to webxdc

* add selfName()

* return selfAddr() if selfName() is empty

* rename deltachat.js to webxdc.js

* observer correct event

* rename getBlobFromArchive() to getWebxdcBlob()

* show webxdc app name in title bar

* swap payload and descr in sendUpdate() (adapt to new core api)

* allow user-defined-texts for webxdc apps, make room for icon+name

* show webxdc icon and name in chats

* render webxdc drafts accordingly

* allow configuring drafts

* do not destroy webxdc-message to be sent out by removing it via setDraft(null)

* fix crash when replying to webxdc messages

* add webxdc messages to profile's document tab

* hide 'search menu' for webxdc apps

* show app summary beside app icon

* remove outdated comment

* add precautious WebView restrictions

* Update src/org/thoughtcrime/securesms/ConversationItem.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

* Update src/org/thoughtcrime/securesms/ConversationItem.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

* Update src/org/thoughtcrime/securesms/ConversationActivity.java

Co-authored-by: Hocuri <hocuri@gmx.de>

* Webxdc requires at least Android 5 Lollipop

see https://github.com/deltachat/deltachat-android/pull/2174#discussion_r785436874

* recognize .xdc files on android10

based on @Hocuri's findings in #2188

Co-authored-by: Simon Laux <mobile.info@simonlaux.de>
Co-authored-by: adbenitez <asieldbenitez@gmail.com>
Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>
Co-authored-by: Hocuri <hocuri@gmx.de>
2022-01-18 10:52:09 +01:00
adbenitez 1fad77671c Merge remote-tracking branch 'upstream/master' 2021-11-10 13:58:14 -05:00
cyBerta 18c3306832 Merge pull request #2088 from deltachat/provider-app-support
provider app support
2021-11-10 14:54:01 +01:00
adbenitez 952f82f1a3 Merge remote-tracking branch 'upstream/master' 2021-11-07 14:20:21 -05:00
bjoern 18ee751485 fix backups for android10 (#2122)
- Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)
  was not writable for android10 (older and newer androids are okay)

- the import selectMediaType() showed up,
  however never did show the exported file on android10 (also here, older and newer androids are okay)

re-adding the flag `android:requestLegacyExternalStorage="true"` that was removed in #2087
fixed both problems, at least in the emulator.

seems as if the flag is still respected when running on sdk29 even when targeting sdk30;
when running on sdk30, however, the flag is ignored.

at least the following doc does not say that the flag is needless in sdk30:
https://developer.android.com/reference/android/R.attr#requestLegacyExternalStorage
2021-11-07 13:33:49 +01:00
adbenitez 995b88d620 Merge remote-tracking branch 'upstream/master' 2021-11-04 15:18:12 -04:00
cyberta f5d6112f07 initial IPCAddAccountService implementation: receive messages from other apps 2021-11-04 12:51:21 +01:00
Hocuri f34ef4db13 Target SDK/API 30 (#2087)
* Target SDK 30

* Pull changes from Signal

* Bugfix, make photo view rail be shown again

* Fix capturing images using an external camera

* Make backups work. Unfortunately, I did this by copying the backup file to the private storage first.

* Fix: Show the correct folder name when exporting attachment

Before, after exporting an attachment, on newer Android versions (and
maybe also on older ones) the toast always said
`File exported to "media"`.

* Update src/org/thoughtcrime/securesms/WelcomeActivity.java

Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>

Co-authored-by: bjoern <r10s@b44t.com>
Co-authored-by: Asiel Díaz Benítez <adbenitez@nauta.cu>
2021-11-04 12:23:17 +01:00
adbenitez 90e64b4e56 Merge remote-tracking branch 'upstream/master' 2021-10-13 15:37:01 -04:00
Hocuri d8913cf17e Adapt to new direct share api (#1852)
Fix #1777
2021-10-13 17:33:55 +02:00
adbenitez 6df617948f Merge remote-tracking branch 'upstream/master' 2021-07-08 23:34:27 -04:00
Hocuri b3fea81bed Implement a basic connectivity view
The non-squashed original commits are available at 243bd3a56:

* First, quick and dirty version

* Basic HTML connectivity view

* Codestyle, automatically refresh

* Make it accessible from the settings

* Improve usability

I did some user-testing with my family, these are the results:
- Added an emoji to the html page (red dot for not connected, and so on)
- Adapted error messages for SMTP:
  "Not started" -> "(You did not try to send a message recently)"
  "🟢 Connected" -> "🟢 Your last message was sent successfully"
- "Not connected" is misleading, because they think that this means that there is no internet connection.
  But "Not connected" can have other causes, like, a not responding server or a changed-but-not-updated-in-DC password

  Possible solutions:
  - "Not connected" -> "Not connected with gmx.de" (or whatever comes after the '@' in configured_addr). The problem: some people have an own domain for their emails, but no own servers. "Not connected with <your domain>" and might make them think that the problem is that DC tries to connect to the server <your domain>, while the server is hosted at Strato.com.
  - We can ask the system whether there currently is network and then show another error message. The problem: Sometimes the system is wrong.

* Remove error_network

* Remove server_response string

* Move `getConnectivitySummary()` to `DcHelper`

* Implement the changes we agreed on

* Remove string error_no_network

* small fixes
2021-07-08 22:50:22 +02:00
adbenitez 610dc4fd6a Merge remote-tracking branch 'upstream/master' 2021-07-02 14:26:13 -04:00
adbenitez 27df7fa943 add more case variations 2021-06-29 22:39:21 +02:00
adbenitez a267cdd151 handle URLs starting with OPENPGP4FPR: 2021-06-29 22:39:21 +02:00