ubuntu-phone team mailing list archive
-
ubuntu-phone team
-
Mailing list archive
-
Message #18073
Re: Xmlhttprequest (XHR) from qt/qml
Hi
Check my project: https://github.com/QtRoS/yadpro. XMLHttpRequest works
fine there.
AFAIK
applicationName: "yadpro"
in MainForm should be equal to name from manifest. Or something like this.
2016-02-03 16:50 GMT+03:00 Mathijs Veen <mathijsv33n@xxxxxxxxx>:
> Hi Mike,
>
> I have yes. That shouldn't be the issue.
> Actually I had already been searching for an app that does XHR
> succesfully, just hadnt found it yet. I will dive into your code and now
> I'm sure I will spot where I'm going wrong :)
>
> I was starting to doubt it could be done at all.
>
>
> cheers!
>
> Mathijs
>
> On Wed, Feb 3, 2016 at 2:31 PM, Mike Sheldon <mike@xxxxxxxxxxxxx> wrote:
>
>> Hi Mathjis,
>>
>> Have you added the "networking" policy group to your app armor
>> permissions? I'm using XHR in Podbird for fetching RSS feeds and it
>> works without any issues.
>>
>> Cheers,
>> Mike.
>>
>> On Wed, 2016-02-03 at 04:32 +0100, Mathijs Veen wrote:
>> > hello everyone
>> >
>> > I was working on an app that makes use of xmlhttp requests.
>> > xmlhttprequest (XHR) is supported in qt qml since way back when. Both
>> > GET and POST. I have a working testapp that runs fine on the
>> > desktop. But it fails when it is deployed to my phone. It seems
>> > apparmor does not allow it:
>> >
>> > Loading module: 'libubuntu_application_api_touch_mirclient.so.3.0.0'
>> > QNetworkManagerInterface::QNetworkManagerInterface(QObject*)
>> > propsReply "An AppArmor policy prevents this sender from sending this
>> > message to this recipient; type="method_call", sender=":1.862"
>> > (uid=32011 pid=23829 comm="/usr/lib/arm-linux
>> > -gnueabihf/qt5/bin/qmlscene Main")
>> > interface="org.freedesktop.DBus.Properties" member="GetAll" error
>> > name="(unset)" requested_reply="0"
>> > destination="org.freedesktop.NetworkManager" (uid=0 pid=1698
>> > comm="NetworkManager ")"
>> > QNetworkManagerInterface::QNetworkManagerInterface(QObject*) nmReply
>> > "An AppArmor policy prevents this sender from sending this message to
>> > this recipient; type="method_call", sender=":1.862" (uid=32011
>> > pid=23829 comm="/usr/lib/arm-linux-gnueabihf/qt5/bin/qmlscene Main")
>> > interface="org.freedesktop.NetworkManager" member="GetDevices" error
>> > name="(unset)" requested_reply="0"
>> > destination="org.freedesktop.NetworkManager" (uid=0 pid=1698
>> > comm="NetworkManager ")"
>> > "Object path cannot be empty"
>> >
>> > syslog, however does not show any apparmor=DENIED lines, but contains
>> > this for my app:
>> >
>> > Feb 3 03:10:07 ubuntu-phablet kernel: [56478.996203] type=1400
>> > audit(1454465407.330:1757): apparmor="STATUS"
>> > operation="profile_replace" profile="unconfined"
>> > name="tstxhttp.matv1_tstxhttp_0.1" pid=27998 comm="apparmor_parser"
>> >
>> > not sure what that means exactly though.
>> >
>> >
>> > On irc I was advised to do a bug report. However, knowing that this
>> > has been a known issue for quite some time and at least one
>> > longstanding lp-bug exists, I thought I would ask here first what I
>> > ought to do.
>> >
>> > - On this mailinglist a previous discussion is here:
>> > https://lists.launchpad.net/ubuntu-phone/msg14407.html
>> >
>> > But it is left unconcluded.
>> >
>> >
>> > -the only related bug that I know of is this:
>> > https://bugs.launchpad.net/ubuntu/+source/qtbase-opensource-src/+bug/
>> > 1404188
>> >
>> > Now I do not know much about apparmor but I far as I understand the
>> > discussion, jdstrand is basically saying that the phone trust model
>> > makes it so that for an app like mine to work, it would have to
>> > expose networkmanager directly to 'untrusted' apps, which could also
>> > expose unwanted things like mac address and such things to those
>> > apps.
>> >
>> > It is suggested that using connectivity-api could help. But I dont
>> > quite see how, in scenario's like mine. Also, that bug is still
>> > marked as unresolved.
>> >
>> >
>> > So my question is: Whats the status of this? Should I or should I not
>> > be expecting XHR to work (now or in the future) on the phone?
>> > (Somehow, it seems kinda weird that an app on 'touch' can not use
>> > such a common api when any app on any desktop can).
>> >
>> > Should I perhaps do a new bug report?
>> >
>> >
>> > Please advise,
>> >
>> > cheers
>> >
>> > Mathijs
>> > --
>> > Mailing list: https://launchpad.net/~ubuntu-phone
>> > Post to : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
>> > Unsubscribe : https://launchpad.net/~ubuntu-phone
>> > More help : https://help.launchpad.net/ListHelp
>>
>
>
> --
> Mailing list: https://launchpad.net/~ubuntu-phone
> Post to : ubuntu-phone@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ubuntu-phone
> More help : https://help.launchpad.net/ListHelp
>
>
Follow ups
References