1
0
Commit Graph

17576 Commits

Author SHA1 Message Date
SomberNight
70c70eec35 contrib/release_www.sh: put android versionCode in "version" file
This can be used by the F-Droid buildserver to detect new versions
and release updates automatically.

ref:
https://github.com/spesmilo/electrum/pull/9221#issuecomment-2386549086
https://f-droid.org/en/docs/Build_Metadata_Reference/#UpdateCheckMode
2024-10-14 16:05:02 +00:00
SomberNight
def89a90bc contrib/release_www.sh: minor clean-up 2024-10-14 16:04:38 +00:00
SomberNight
0d4e8f62ba android build: exclude fastlane/ from apk
related:
7fb7ac919c
https://github.com/spesmilo/electrum/issues/9215#issuecomment-2395249194
2024-10-14 16:04:23 +00:00
SomberNight
28bfa56577 (trivial) contrib/make_packages.sh: print success msg when done 2024-10-14 16:00:57 +00:00
SomberNight
4dc2eb9469 android build: use spesmilo/ fork of p4a and buildozer
- fdroid maintainers asked that releases use fixed forks of p4a and buildozer,
  so now we use the newly created forks in the spesmilo org. I plan to keep using
  my existing contributor-specific repos for development, but whatever we push
  to electrum master, should use the new spesmilo/ forks.
  see https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15858#note_2136345746
  - Also, I added branch protection rules for branches named "electrum_*", so if
    we name the branches that are actually used in releases as such, we won't
    accidentally force-push them. (ref https://github.com/spesmilo/electrum/issues/8162)
    I think we can just create a new branch whenever we would want to force-push
    the existing one.
- also factored out some parameters so that it is easier to programmatically
  access them from the fdroid build script.
  see https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15858#note_2136094409
2024-10-14 16:00:44 +00:00
SomberNight
4773815830 android readme: extend "access datadir on Android from desktop"
- add commands to restrict unix permissions for pushed files
- add notes for "multiple user profiles" case
2024-10-14 16:00:16 +00:00
ThomasV
fa1eb9f286 update hash for winehq.key
Looks like upstream key file changed. Still the same crypto key, just updated expiration date.

```
$ sha256sum winehq_20*
78b185fabdb323971d13bd329fefc8038e08559aa51c4996de18db0639a51df6 *winehq_2019.key
d965d646defe94b3dfba6d5b4406900ac6c81065428bf9d9303ad7a72ee8d1b8 *winehq_2024.key

$ gpg winehq_2019.key
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
pub   rsa3072 2018-12-10 [SC]
      D43F640145369C51D786DDEA76F1A20FF987672F
uid           WineHQ packages <wine-devel@winehq.org>
sub   rsa3072 2018-12-10 [E] [expired: 2020-12-09]

$ gpg winehq_2024.key
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
pub   rsa3072 2018-12-10 [SC]
      D43F640145369C51D786DDEA76F1A20FF987672F
uid           WineHQ packages <wine-devel@winehq.org>
sub   rsa3072 2018-12-10 [E]
```

Co-authored-by: SomberNight <somber.night@protonmail.com>
2024-10-14 15:59:16 +00:00
SomberNight
d415d2ab89 android build: add own logic to calculate versionCode
Use our own logic to go from ELECTRUM_VERSION to numeric android versionCode,
instead of using the default conversion done by python-for-android.

Even before this, we were already patching p4a to modify their logic (see [0]).
This commit changes that logic again, and moves it into a separate script in our repo.
- calculation change is due to the f-droid maintainers asking for the
  arch code to be in the least significant digits (instead of most sig digits) (see [1])

I have pushed and changed to a new p4a branch, which is just a copy of the previous one
with 3 commits related to versionCode calc squashed.

[0]: edb7e4fe6d
[1]: https://github.com/spesmilo/electrum/issues/9210#issuecomment-2380559324
2024-10-14 15:53:40 +00:00
SomberNight
e72b7ca25c version.py: rm APK_VERSION
related: https://github.com/spesmilo/electrum/issues/9210#issuecomment-2376572832
2024-10-14 15:53:19 +00:00
thecockatiel
a3786a4f85 chore: add fastlane metadata for f-droid (#9211)
* chore: add fastlane metadata for f-droid

* chore: add short description

* chore: use the correct short description
2024-10-14 15:53:01 +00:00
SomberNight
6ebdbf0401 android: update p4a ref
to have 58d21ad89b
> reproducible apks: strip file path prefix from .pyc files

related: https://github.com/spesmilo/electrum/issues/9215
2024-10-14 15:52:32 +00:00
SomberNight
08127a608b android build: bump python version (3.8.18->3.10.14)
cffi also had to be updated for this, and corresponding commit backported from upstream p4a
2024-10-14 15:52:00 +00:00
SomberNight
b79ee9b0ef android: update p4a ref
to have 04e80084eb
> recipe: libsecp256k1: enable modules for schnorr sigs
2024-10-14 15:51:19 +00:00
SomberNight
2917fde598 android: set target_sdk_version to 34
To comply with new google play store requirement:

> Starting August 31 2024:
> - New apps and app updates must target Android 14 (API level 34) or higher to be submitted to Google Play

AFAICS, we do not need to adapt to any of the changes.
https://developer.android.com/about/versions/14/behavior-changes-14
2024-10-14 15:39:17 +00:00
SomberNight
7b1d088d32 android: add comment that OS push notifications are broken 2024-10-14 15:38:58 +00:00
SomberNight
3ec16a08e5 build: include tests/ in tarballs
closes https://github.com/spesmilo/electrum/issues/9207
2024-10-14 15:38:31 +00:00
ThomasV
1c9d31b938 qml: do not display success if swap failed.. 2024-10-14 15:38:18 +00:00
Soren Stoutner
32c97145ef revealer plugin: move font initialisation to earlier
Co-authored-by: SomberNight <somber.night@protonmail.com>
2024-10-14 15:37:23 +00:00
Soren Stoutner
c187f64508 Update Source Sans Pro font to the current Source Sans 3. 2024-10-14 15:37:15 +00:00
SomberNight
b55c486f1f build: update pinned qdarkstyle (partial rerun freeze_packages)
related https://github.com/spesmilo/electrum/pull/9189
(version 3.2 added support for qt6, so this version supports both qt5 and qt6)
2024-10-14 15:34:53 +00:00
SomberNight
7cc8666061 follow-up testnet4 stuff: trivial clean-up
re https://github.com/spesmilo/electrum/pull/9197

localhost in servers list should only be for regtest-like networks
2024-10-14 15:34:24 +00:00
wakiyamap
213be4f617 remove BOLT11_HRP_INV_DICT 2024-10-14 15:29:51 +00:00
wakiyamap
de4c1b65fe Add suport testnet4 2024-10-14 15:29:29 +00:00
SomberNight
1c4bca7dc5 sdist README: document differences between sourceonly and normal tar.gz 2024-10-14 15:28:16 +00:00
SomberNight
4ff13f598d build: appimage: dl xcb-util as debian src pkg instead of upstream git
The upstream git repo has been unreachable for at least days.
2024-10-14 15:26:55 +00:00
SomberNight
aeb0a168b5 qt gui: use QGuiApplication.setApplicationName
I noticed that when running from source on macOS, the OS menubar has an "About Python" menu item,
instead of an "About Electrum" menu item. I tried to fix that by this, but actually it is not working :P

Nevertheless, this looks useful at least on Linux and Windows. E.g. when instantiating a new dialog
without an explicit title, the qt application name is used as default.

The application name, without this change AFAICS was already "Electrum" when running any of the binaries.
However when running from source, it was in some cases "python" or "run_electrum" or even "electrum-4"
(depending on OS and how the main script is started).
Now it is consistent -- except on macOS it still is not, as there it really wants to look for a .plist...
2024-10-14 15:26:32 +00:00
Jamie C. Driver
9a84bb3211 jade: update Jade api to 1.0.31
This extends the serial api to recognise recently supported hardware.
2024-10-14 15:21:46 +00:00
SomberNight
5f43627b7e gui: qt: tx dialog: add option to copy scriptpubkey of output
if there is no corresponding address
(otherwise due to "..." elision, the full spk would be inaccessible)
2024-10-14 15:21:18 +00:00
SomberNight
ae4dd7018b hww: ledger: update udev rules and model ids
see https://github.com/bitcoin-core/HWI/pull/746

maybe closes https://github.com/spesmilo/electrum/issues/9179
2024-10-14 15:20:49 +00:00
SomberNight
79c0853658 qml/android: set max screen brightness when displaying QR codes
In some cases this makes it much easier to successfully scan a QR code.
I was trying to scan a PSBT using a laptop camera from my phone screen for 2 minutes, until I realised the screen brightness was the issue.  o.O
2024-10-14 15:20:29 +00:00
SomberNight
6f78512222 build: update pinned trezorlib (partial rerun freeze_packages)
related https://github.com/spesmilo/electrum/pull/9141
2024-10-14 15:19:40 +00:00
SomberNight
3d3e6f812c qt wizard WCWalletName: focus password textedit
- between the Back btn and the Next btn, the latter should have priority for focus
- but if the user needs to enter the wallet password, that textedit should have focus

closes https://github.com/spesmilo/electrum/issues/9157
related c6802adbae
2024-10-14 15:19:08 +00:00
SomberNight
a19e14bc2c wallet.get_tx_status: fix incorrect feerate for partial txs
The history tab would show an incorrect feerate for partial/unsigned (local) txs,
if they had any p2sh/p2wsh txins. We would just guess the script is p2wpkh, and
use that for the size calc. Now with calling add_info_from_wallet, the correct
size is used to calculate the feerate.

(The gui tx dialogs call add_info_from_wallet independently, so the size/feerate
shown there were already correct.)
2024-10-14 15:18:33 +00:00
ThomasV
f7d0ac27a6 new wizard: set keystore password. fixes #9147 2024-10-14 15:17:24 +00:00
Darsey Litzenberger
d20e01b604 trezor: Fix for trezor library version 0.13.9
This enables support for the Trezor Safe 5.
2024-10-14 15:16:21 +00:00
SomberNight
ebfc701b97 qt gui: clean-up efilter when exiting
related: https://github.com/spesmilo/electrum/issues/6889#issuecomment-2184052577
2024-10-14 15:15:49 +00:00
SomberNight
9d6c818283 trustedcoin: Wallet_2fa.make_unsigned_transaction to use **kwargs
We often forget updating the method signature of Wallet_2fa.make_unsigned_transaction
when changing Abstract_Wallet.make_unsigned_transaction.
2024-10-14 15:14:50 +00:00
SomberNight
c42cbd0577 trustedcoin: sanitize error messages coming from 2fa server
related https://github.com/spesmilo/electrum/issues/9096
2024-10-14 15:14:30 +00:00
SomberNight
546d570ca2 util.error_text_str_to_safe_str: truncate long errors
The messages are sometimes logged and sometimes shown to the user,
- for logging we might not want to truncate or have higher limits,
- but when shown to the user, we definitely want to truncate the error text.
It is simplest to just do the truncation here, at the lowest level.

Note that we usually prepend the error text with a header e.g. "[DO NOT TRUST THIS MESSAGE]"
and if the error text is too long, this header at the beginning might get "lost" in some way.
Hence we should truncate the error text.
2024-10-14 15:13:01 +00:00
SomberNight
73d667f986 trustedcoin: rm dead code 2024-10-14 15:12:29 +00:00
SomberNight
178f139543 mnemonic: make_seed: add sanity-check
When going through the wizard, this case would previously have errored later in the flow. (for '2fa' at least)
2024-10-14 15:11:57 +00:00
SomberNight
cb4539c73f mnemonic: rename seed_type() fn
Some functions have an argument named "seed_type" in which it was annoying to call the seed_type() fn.
(especially for functions inside the same module)
2024-10-14 15:11:43 +00:00
SomberNight
d6006b0942 soothe flake8
```
./tests/test_mnemonic.py:249:9: B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
        with self.assertRaises(Exception):
        ^
1     B017 `assertRaises(Exception)` and `pytest.raises(Exception)` should be considered evil. They can lead to your test passing even if the code being tested is never executed due to a typo. Assert for a more specific exception (builtin or custom), or use `assertRaisesRegex` (if using `assertRaises`), or add the `match` keyword argument (if using `pytest.raises`), or use the context manager form with a target.
```
2024-10-14 15:10:17 +00:00
SomberNight
8def0bd6c2 wizard: fix regression: allow passphrase for some '2fa' seeds
fixes https://github.com/spesmilo/electrum/issues/9088
2024-10-14 15:08:07 +00:00
SomberNight
abea2bb268 tests: wallet_vertical: re pre-2.7 "2fa" seeds, test both 24 and 25 len 2024-10-14 15:07:33 +00:00
SomberNight
7fae4649c6 interface: nicer error for CA-signed "Hostname mismatch" certs
Previously when encountering a CA-signed cert that failed verification with "Hostname mismatch",
we would
1. erroneously mark it as self-signed
2. save its cert to pin it
3. when connecting to it later, and being served a CA-signed cert, we would reject the connection
  - I think this is because we use the saved cert (the peer cert, just the last cert in the chain) as if it was a root CA,
    and then during the connection we try to verify against that root. This fails as we are served a different root then.
Error logged in step(3):
```
  3.85 | W | i/interface.[wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion:50002] | Cannot connect to main server due to SSL error (maybe cert changed compared to "/home/user/.electrum/testnet/certs/wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion"). Exc: ConnectError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))
```

This commit fixes step(1), we won't mark the cert as self-signed, instead the error is propagated out and the connection closed.
```
 35.05 | I | i/interface.[wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion:50002] | disconnecting due to: ErrorGettingSSLCertFromServer(ConnectError(SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion'. (_ssl.c:1007)")))
```

Compare:
- SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'wirg2tsto7rme7n26lkd3ivbvxmjyy2pktlozwjuep22jcsfsghfqbqd.onion'. (_ssl.c:1007)")
  - verify_code=62
- SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1007)')
  - verify_code=18

Note: the verify_code constants look stable, though they might be openssl-specific. I guess that's ok(?)
140540189c/include/openssl/x509_vfy.h.in (L224)
2024-10-14 15:06:13 +00:00
ThomasV
9ee998c3be maybe_cleanup_forwarding: fix crash if payment_key not in self.received_mpp_htlcs 2024-10-14 15:02:35 +00:00
SomberNight
7e29214219 daemon error-handling: fix traceback.format_exception() on old python
The new API for traceback.format_exception was only added in python 3.10 (91e93794d5).
2024-10-14 15:00:10 +00:00
SomberNight
559184dc09 network: (trivial) simplify send_http_on_proxy 2024-10-14 14:58:49 +00:00
SomberNight
78050fb999 lnurl: better error messages
re https://github.com/spesmilo/electrum/issues/9078
2024-10-14 14:57:57 +00:00