Bug 487874 - Unable to open the AFC filesystem on an iPhone/iPad in KDE Plasma 6
Summary: Unable to open the AFC filesystem on an iPhone/iPad in KDE Plasma 6
Status: RESOLVED FIXED
Alias: None
Product: kio-extras
Classification: Frameworks and Libraries
Component: AFC (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-01 10:29 UTC by Pavel Urusov
Modified: 2025-03-05 01:54 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
KIO Client error message (36.48 KB, image/png)
2024-06-01 10:29 UTC, Pavel Urusov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Urusov 2024-06-01 10:29:10 UTC
Created attachment 170041 [details]
KIO Client error message

SUMMARY
It is impossible to open the AFC filesystem on devices running iOS/iPad OS in Plasma 6.

STEPS TO REPRODUCE
1. Connect an iPhone or an iPad to a PC running KDE Plasma 6
2. In the Disk & Devices pop-up window, select "Portable Media Player -> Open in File Manager"
3. Observe the resulting error message

OBSERVED RESULT
An error message claiming that the AFC URL does not exist.

EXPECTED RESULT
Dolphin shows the AFC filesystem on the connected device.

SOFTWARE/OS VERSIONS

Operating System: openSUSE Tumbleweed 20240524
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Kernel Version: 6.9.1-1-default (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
The error happens regardless of whether libimobiledevice and fusermount are installed on the system or not.

I can manually mount the AFC device using idevicepair and fusermount, so the problem is definitely on the KDE's side of things.
Comment 1 YOYOWORKOUT 2024-06-11 08:47:37 UTC
Same error on KDE neon 6.1-dev , either with older ios device ( ipad min 4 ios 15.7.8)
Comment 2 Pavel Urusov 2024-09-17 14:56:55 UTC
The issue still persists after update to kf6-kio-6.6.0 (openSUSE TW 20240916)
Comment 3 Benjamin Dedieu 2025-03-01 17:04:02 UTC
I can confirm the bug on Fedora:
Operating System: Fedora Linux 41
KDE Plasma Version: 6.3.2
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.5-200.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 4 Bug Janitor Service 2025-03-03 11:28:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kio-extras/-/merge_requests/416
Comment 5 Kai Uwe Broulik 2025-03-03 11:38:28 UTC
Can you provide the output of

QT_LOGGING_RULES='kf.kio.workers.afc*=true' kioclient ls afc:/
Comment 6 Benjamin Dedieu 2025-03-03 11:57:06 UTC
(In reply to Kai Uwe Broulik from comment #5)
> Can you provide the output of
> 
> QT_LOGGING_RULES='kf.kio.workers.afc*=true' kioclient ls afc:/

I get this:
```
kf.kio.workers.afc: *** Starting kio_afc
kf.kio.workers.afc: idevice event ADD for b440e122a57e7d73c5cfda92e7ea9d5c3b906c47
kf.kio.workers.afc: list directory: QUrl("afc:/")
kf.kio.workers.afc: list directory: QUrl("afc://b440e122a57e7d73c5cfda92e7ea9d5c3b906c47/")
kioclient : Le fichier ou le dossier B440E122A57E7D73C5CFDA92E7EA9D5C3B906C47 n'existe pas.
```
Comment 7 Kai Uwe Broulik 2025-03-03 17:11:31 UTC
Ah, so it is indeed a case issue I think. Any chance you could try https://invent.kde.org/network/kio-extras/-/merge_requests/416
Comment 8 Kai Uwe Broulik 2025-03-04 07:58:51 UTC
Git commit b58bbf65264329ed0b6fd76f747b22d7731ec14f by Kai Uwe Broulik.
Committed on 03/03/2025 at 17:13.
Pushed by broulik into branch 'master'.

afc: Explicitly toUpper device ID when inserting

AfcUrl upper-cases the device id but we didn't explicitly
do this when inserting/removing the device, so when a device
has a lower-case ID, it will fail to find it.

M  +4    -3    afc/kio_afc.cpp

https://invent.kde.org/network/kio-extras/-/commit/b58bbf65264329ed0b6fd76f747b22d7731ec14f
Comment 9 Kai Uwe Broulik 2025-03-04 08:26:18 UTC
Git commit 589c1e7ce5e83bf56b11a68e9d8fc6b8c202123f by Kai Uwe Broulik.
Committed on 04/03/2025 at 07:58.
Pushed by broulik into branch 'release/24.12'.

afc: Explicitly toUpper device ID when inserting

AfcUrl upper-cases the device id but we didn't explicitly
do this when inserting/removing the device, so when a device
has a lower-case ID, it will fail to find it.


(cherry picked from commit b58bbf65264329ed0b6fd76f747b22d7731ec14f)

Co-authored-by: Kai Uwe Broulik <kde@privat.broulik.de>

M  +4    -3    afc/kio_afc.cpp

https://invent.kde.org/network/kio-extras/-/commit/589c1e7ce5e83bf56b11a68e9d8fc6b8c202123f
Comment 10 Benjamin Dedieu 2025-03-04 17:19:22 UTC
(In reply to Kai Uwe Broulik from comment #7)
> Ah, so it is indeed a case issue I think. Any chance you could try
> https://invent.kde.org/network/kio-extras/-/merge_requests/416

Hi, I was trying to rebuild plasma from source with `kde-builder worskpace` in order to have a clean install from master before building kio-extras from your branch. However, I have not done this since last year and I have problems building kwin. Just in case you have an idea I get this error in the log:
```
1714:23: error: ‘to’ is not a member of ‘std::ranges’
 1714 |     }) | std::ranges::to<QList>());
      |                       ^~
```
It also warns me that I miss the optional dependency Qt6QmlCompilerPlusPrivateTools, but  I have qt6-qtdeclarative-devel installed (where I think the QML tools are).

Otherwise is there a way to rapidly test your kio-extras branch directly in the current session, without going to the development environment session ?

Thank you for the merge request.
Comment 11 Benjamin Dedieu 2025-03-05 01:54:43 UTC
I was finally able to build it (my kde-builder error just came from the fact I used g++13 instead of g++14).
And it works !
Now I can see my device recognized in the task bar, and no more error indicating that the device is not found.
So I think the bug of the device afc number being not recognized is fixed. Thank you very much !

However there is a new error that appears for me: "Error code lockdownd".
This new error could be linked to the phone not being paired properly because of a wrong SSL config in Fedora41, see https://github.com/libimobiledevice/libimobiledevice/issues/1606 and https://bugzilla.redhat.com/show_bug.cgi?id=2321958.
A workarround for this (until it is fixed by Fedora), is to get back to the crypto policy of Fedora 40 with this command : `sudo update-crypto-policies --set FEDORA40`.