Problems with wpa_gui

TL;DR: How do I programmatically save wi-fi secrets?

ANTIFACT
maybe there’s a bug in the wi-fi GUI, because I had troubles trying to input my 63-byte password. I tried twice, which is a torture using Pinephone virtual keyboard, and failed. When I connected using the USB cable I found the password it saved was missing the last character. I fixed it and now the phone works. In the office.

When I move out, if there are push-button capable routers, I want to use them. Life is too short to copy gibberish passwords from the back of the routers. Since wpa_supplicant features a wpa_gui interface, I tried to get it by installing profiles (getarmprofiles) to no avail. So I went to archlinux repositories (is that the correct place?) However, buildarmpkg failed complaining that it doesn’t know a signature. I received that key in gpg, but buildarmpkg kept complaining. So I downloaded the source from w1.fi, copied wpa_supplicant_config from archlinux to .config, built it and installed it by hand:

$ qmake wpa_gui.pro
$ make
$ sudo cp wpa_gui /usr/bin/
$ sudo cp wpa_gui.desktop /usr/share/applications/
$ sudo cp wpa_gui.svg /usr/share/icons/hicolor/scalable/apps/

It didn’t work. I changed the executable to setuid and it didn’t run at all, because of Qt5 trap. It has to be overridden like so:

--- a/main.cpp	2022-01-16 21:51:29.000000000 +0100
+++ b/main.cpp	2023-02-16 18:51:08.000000000 +0100
@@ -33,6 +33,7 @@
 
 int main(int argc, char *argv[])
 {
+	QCoreApplication::setSetuidAllowed(true);
 	WpaGuiApp app(argc, argv);
 	QTranslator translator;
 	QString locale;

THE PROBLEM
wpa_gui now works like a charm. Some graphics are too wide to fit in the small Pinephone screen, but it is able to connect after pushing the AP button. However, it cannot save the results. It complains that it needs update_config=1. Of course I tried and set that in wpa_supplicant.conf, to no avail. The daemon runs with a -O option, so I guess it has to be configured by DBus. How do I do that?

BTW, after wpa_gui connects, it writes a file in NM’s system-connections, including the wi-fi password. The file is lost on reboot. Perhaps wpa_gui would save the secret in wpa_supplicant.conf, which is not going to work, since that file is not used. What is the long term storage for wi-fi secrets?