UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Trying to revive 'ubtd' (Bluetooth file transfer)

    Scheduled Pinned Locked Moved Unsolved App Development
    43 Posts 4 Posters 3.4k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • G Offline
        gpatel-fr @PhAndersson
        last edited by

        @PhAndersson

        My knowledge of apparmor is basic unfortunately. In particular, interaction with dbus is something I never looked at before UT, and bluetooth and network management with apparmor is totally unknown to me.

        Yes my suggestion of using network bluetooth was not very well thought out, I was believing that maybe there was special in associating the two, as if there was a right called network_bluetooth. My bad 🙂

        This said, there is something that bothers me in your log: it suggest that there is a denial in the sending FROM the server (the systemd service) TO your app. Usually when a sending is denied, it is the sender that is lacking rights.
        So following this idea, it could be the system itself that is missing a configuration. However, see above, I have no idea how rights are managed for the bluetooth services.
        Maybe all that is needed is to add an apparmor profile for the obexd executable, but often the obvious solution is wrong.
        Note that if you want to test it, there is no need to turn your rootfs r/w, with overlay or bind-root you can 'add' stuff in read only directories.

        Sorry not to be more specific, but going deep in system administration takes time and concentration and I'm currently in other stuff.

        1 Reply Last reply Reply Quote 0
        • G Offline
          gpatel-fr @PhAndersson
          last edited by

          @PhAndersson

          Right, while searching for another problem, I just stumbled on something that looks like an answer.
          there is in this directory:
          /etc/dbus-1/system.d
          a bunch of files configuring the authorizations for dbus; for example (taken for its brevity):

          cat com.lomiri.UserMetrics.conf 
          <!DOCTYPE busconfig PUBLIC
           "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
           "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
          <busconfig>
          
                  <policy user="usermetrics">
                          <allow own="com.lomiri.UserMetrics"/>
                  </policy>
          
                  <policy context="default">
                          <allow send_destination="com.lomiri.UserMetrics"/>
                          <allow receive_sender="com.lomiri.UserMetrics"/>
                  </policy>
          

          Now, it's sure that the system.d directory does not seem the right place for a user level service.
          At the moment I have no clue where a file configuring the dbus authorization for the org.bluez.obexd service should be created.
          But I tend to think that creating one is the proper thing to do because I don't see a reason why obexd should be forbidden to send message to its agents. It should be allowed whatever security reason there is to block general message sending. So this could be the proper way (TM) for your application to run confined.

          1 Reply Last reply Reply Quote 0
          • P Offline
            PhAndersson
            last edited by

            Another quick update.

            I'm really pleased to announce that I got the SharePlugin part of the app working as well. I successfully pushed a file from my Pixel 3a to my (Linux) laptop over BT, but even more importantly for me, I was able to push selected contacts to my car kit 🙂

            The user interface is still too rough for the app to be published as is (at this stage, you have to select the target device based on its MAC address, which is far from convenient), but I'm working on it.

            Xiaomi Mi A2 (16.04 OTA-25/stable) with 2 SIMs
            Daily driver: Google Pixel 3a (20.04 OTA-11/stable) [was: Nokia N900 (Maemo) from 2009].

            G 1 Reply Last reply Reply Quote 7
            • G Offline
              gpatel-fr @PhAndersson
              last edited by

              @PhAndersson

              how about setting up a public directory of what you have (if you have cleared the license question) ? It'll allow me to test it under Noble and possibly send a MR to gitlab once I'm sure that it works. Don't want to harass you of course, it's up to you to decide.

              P 1 Reply Last reply Reply Quote 0
              • P Offline
                PhAndersson @gpatel-fr
                last edited by

                @gpatel-fr said in Trying to revive 'ubtd' (Bluetooth file transfer):

                @PhAndersson

                how about setting up a public directory of what you have (if you have cleared the license question) ? It'll allow me to test it under Noble and possibly send a MR to gitlab once I'm sure that it works. Don't want to harass you of course, it's up to you to decide.

                Yes, the licensing issue has been cleared up. Michael Zanetti agreed with me using the GPL v3.

                What I'm working on right now is getting the code in a state where I could submit it on the OpenStore (with the understanding that it would need a full review as it still uses an unconfined profile). Of course, in the process, I will also push the code to a public Github repository.

                Can you clarify what the Gitlab merge request you mentioned would be about? I'm afraid I missed a step here.

                Xiaomi Mi A2 (16.04 OTA-25/stable) with 2 SIMs
                Daily driver: Google Pixel 3a (20.04 OTA-11/stable) [was: Nokia N900 (Maemo) from 2009].

                G 1 Reply Last reply Reply Quote 1
                • G Offline
                  gpatel-fr @PhAndersson
                  last edited by

                  @PhAndersson

                  there is no MR yet, it's for this issue

                  P 1 Reply Last reply Reply Quote 0
                  • P Offline
                    PhAndersson @gpatel-fr
                    last edited by

                    @gpatel-fr said in Trying to revive 'ubtd' (Bluetooth file transfer):

                    @PhAndersson

                    there is no MR yet, it's for this issue

                    OK, understood -- I take your point and I'll try to publish ASAP.

                    Xiaomi Mi A2 (16.04 OTA-25/stable) with 2 SIMs
                    Daily driver: Google Pixel 3a (20.04 OTA-11/stable) [was: Nokia N900 (Maemo) from 2009].

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      PhAndersson
                      last edited by

                      Further update: I successfully tested the SharePlugin part of the app while using the enforcing AppArmor profile, which is great news.

                      This means that only the main app (used for receiving files) will need an updated AA profile. But this will wait until after publication of the first version.

                      Xiaomi Mi A2 (16.04 OTA-25/stable) with 2 SIMs
                      Daily driver: Google Pixel 3a (20.04 OTA-11/stable) [was: Nokia N900 (Maemo) from 2009].

                      G 1 Reply Last reply Reply Quote 0
                      • G Offline
                        gpatel-fr @PhAndersson
                        last edited by

                        @PhAndersson

                        excellent !
                        For the record, I remember that you are using Focal on your phone. If you did not look at the last QA for Ubuntu Touch, there was a mention of the 'last' Focal OTA, meaning that 20.04 is on limited life support.

                        P 1 Reply Last reply Reply Quote 0
                        • P Offline
                          PhAndersson @gpatel-fr
                          last edited by

                          @gpatel-fr said in Trying to revive 'ubtd' (Bluetooth file transfer):

                          @PhAndersson

                          excellent !
                          For the record, I remember that you are using Focal on your phone. If you did not look at the last QA for Ubuntu Touch, there was a mention of the 'last' Focal OTA, meaning that 20.04 is on limited life support.

                          Thanks for letting me know. I'll try to get myself a 3rd phone and flash it with Noble, so I can port the app to it while maintaining the original version for a little while.

                          Do you know what device offers the best user experience under Noble?

                          Xiaomi Mi A2 (16.04 OTA-25/stable) with 2 SIMs
                          Daily driver: Google Pixel 3a (20.04 OTA-11/stable) [was: Nokia N900 (Maemo) from 2009].

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post