Commit Graph

124 Commits

Author SHA1 Message Date
Asiel Díaz Benítez a1cc00a17f register to handle i.delta.chat links (#2922) 2024-01-19 23:23:17 -05:00
adbenitez be0fdb7589 add new contact activity 2023-11-03 06:00:40 +01:00
B. Petersen 9b9d2e4daa READ_EXTERNAL_STORAGE permission is still needed for <sdk33 2023-10-12 16:45:37 +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
B. Petersen e7f8dbeb91 split off AttachContactActivity from BlockedAndShareContactsActivity 2023-10-05 00:23:17 +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
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
Hocuri 0e27d445ee Rework how activities interact when forwarding/sharing (#2549) 2023-05-02 10:34:31 +02: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 bae052d735 start with light/dark theme depending on system theme 2023-03-27 16:33:00 -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
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
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
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
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
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
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
Hocuri de9100f8e1 fix stuff 2022-03-26 13:01:26 +01: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
cyBerta 18c3306832 Merge pull request #2088 from deltachat/provider-app-support
provider app support
2021-11-10 14:54:01 +01: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
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
Hocuri d8913cf17e Adapt to new direct share api (#1852)
Fix #1777
2021-10-13 17:33:55 +02: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 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
Hocuri 4c0d03772d Better profile and group picture selection by using attachment selector (#1837)
fix #1836

AvatarSelector is mostly copied from AttachmentTypeSelector. I first started to make it a subclass, but there were so many functions that had to be changed that I decided against it (esp. also the constructor, so I would have had to create another constructor to allow AvatarSelector to bypass the "normal" constructor). Could still be done though, of course.

I think (hope joy) that the commits are clear enough that this can be reviewed commit-by-commit. In the first commit, commenting out code means "Moved somewhere else"

I found it easier to look at the first commit using gitk than GitHub as GitHub doesn't show it as copied from AttachmentTypeSelector but as a new file. (of course you can also just review normally, going throug it file-by-file :)

* Don't show remove button if there is no image yet

* Remove unnecessary animation that just made things look worse

* Delete now-unused ClearProfileAvatarActivity

* For groups, also use the attachment-chooser-dialog

* Remove confirmation dialog for removing avatar (The user has to confirm anyway, and this was not correctly translated)
2021-03-16 11:58:44 +01:00
bjoern 8d9c02dd7a add option to view full (html) message (#1763)
* add get-mime-original apis

* remove unused control

* add 'Show full message' buttons

* split reusable WebViewActivity from LocalHelpActivity

* add FullMsgActivity

* load html via AsyncTask

* adapt to changed api

* handle mailto:-links in WebView

* block loading remote images by default, add user setting always/once/never

* do not hide 'Once' button in always-mode, playing around a day with hidden 'Once' that looks more like a bug :)

* wording: as 'Always' affects all messages, it is better to speak of multiple senders

* wording: use 'Load remote images'

this makes it easier for the user to find the option
if one sees, images are missing in the document.

* wording: shorten text.

* wording: change 'may' to 'can'. 'may' sounds a bit as if someone allows this.

* Don't use AsyncTask

* check 'once' if appropriate

* use lite-colored checkbox-emoji in dark-theme

* add comment about missing error logging

Co-authored-by: Hocuri <hocuri@gmx.de>
2021-01-28 22:53:15 +01:00
Hocuri 438a3aaa43 Handle sendto intents with ShareActivity, not NewConversationActivity 2020-12-09 23:53:10 +01:00
B. Petersen d056b039f0 remove windowSoftInputMode="stateHidden" from profile
according to https://developer.android.com/guide/topics/manifest/activity-element,
it hides the keyboard when creating the activity, but does nothing when navigating back
(as in https://github.com/deltachat/deltachat-android/issues/1606 )

removing the flag closes the keyboard for both directions,
which seems to be the standard behavior and works just well here.

(came over that when checking why the other place where single_line_input was
used (video instance input) works without problems)
2020-09-11 15:02:10 +02:00
cyberta ce8f4a58d2 reuse signals generic foreground service for import export 2020-09-03 17:30:52 +02:00
cyberta 9b25bce3b2 requestLegacyExternalStorage until DC supports scoped storage (must be before targeting API 30) 2020-08-13 15:04:07 +02:00
cyberta 3c0a88227d update location background activity permissions 2020-08-13 14:11:14 +02:00
cyberta 005f707658 ask for install permission if on an attached apk was tapped (Android API 26+), fixes #1492 2020-07-28 10:53:52 +02:00
B. Petersen 2caaa1e097 manually remove summary-notification; this is needed when we cancel the other notifications from within the app 2020-06-15 18:01:59 +02:00
B. Petersen 39bc508a31 remove unused search xml files 2020-04-04 14:09:53 +02:00
B. Petersen 86de9be115 add basic help-search controls 2020-04-04 02:00:56 +02:00
B. Petersen a7212daf40 add registration-qr-scan activity 2020-02-10 14:11:12 +01:00
B. Petersen 0f64d4e9c5 remove unused InviteActivity, it was disabled 9 months ago in #790 2020-01-17 14:08:22 +01:00
B. Petersen afc1f99788 add basic local-help-activity, adapt menus and add a demo-file 2020-01-10 22:58:47 +01:00
Hocuri 268722c0be It compiles ;-) 2020-01-03 00:20:18 +01:00
Hocuri b090232702 Move to qrScanActivity 2020-01-03 00:20:18 +01:00
B. Petersen 786c6cd46f remove unused SET_WALLPAPER permission 2019-12-03 16:21:25 +01:00
cyberta a01fc96547 implement openpgp4fpr url scheme handling 2019-11-28 21:06:10 +01:00
cyberta 7117303e6f replace string reference dc_app_name by app_name 2019-11-27 05:38:14 +03:00
Ozancan Karataş fb7d80f2a6 Delete dc_app_name, use app_name 2019-11-27 01:53:24 +03:00
B. Petersen 638a8e5205 adapt to ndk r20b 2019-11-14 20:47:26 +01:00
B. Petersen bbad6ee584 remove TimerReceiver 2019-11-08 19:38:28 +01:00
B. Petersen fb235b7639 upgrade to androidx support libraries 2019-11-08 01:22:28 +01:00