Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QRemoteObjects not working when app is signed with system signature (Android)

QRemoteObjects not working when app is signed with system signature (Android)

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 3 Posters 406 Views
  • 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.
  • delamorD Offline
    delamorD Offline
    delamor
    wrote on last edited by delamor
    #1

    I am using QRemoteObject to communicate between processes, it works fine so far when the app is signed with a random certificate; but as I need some permissions only granted to apps that has the system signature I signed the app with that signature and then QRemoteObject stops working.

    The failure appears here:

    m_repNode.connectToNode(QUrl(QStringLiteral("local:servicemessenger")));
    
    m_repService = QSharedPointer<ServiceMessengerReplica>(
        m_repNode.acquire<ServiceMessengerReplica>());
    
    bool res = m_repService->waitForSource();
    

    res is null when system signature and true when random signature. I am not seeing anything relevant on logs.. anyone knows what is happening ?

    I am seeing in logs SELinux blocking the creation of socket files, I think that's the cause but I am not sure on solution for this.

    P 1 Reply Last reply
    0
    • delamorD delamor marked this topic as a regular topic on
    • delamorD delamor

      I am using QRemoteObject to communicate between processes, it works fine so far when the app is signed with a random certificate; but as I need some permissions only granted to apps that has the system signature I signed the app with that signature and then QRemoteObject stops working.

      The failure appears here:

      m_repNode.connectToNode(QUrl(QStringLiteral("local:servicemessenger")));
      
      m_repService = QSharedPointer<ServiceMessengerReplica>(
          m_repNode.acquire<ServiceMessengerReplica>());
      
      bool res = m_repService->waitForSource();
      

      res is null when system signature and true when random signature. I am not seeing anything relevant on logs.. anyone knows what is happening ?

      I am seeing in logs SELinux blocking the creation of socket files, I think that's the cause but I am not sure on solution for this.

      P Offline
      P Offline
      patrick521
      wrote on last edited by
      #2

      Hello, @delamor

      It seems SELinux is blocking your application from creating socket files when using the system signature. Follow these steps to resolve it:

      Check SELinux Status and Logs:
      getenforce
      grep avc /var/log/audit/audit.log

      Generate and Load Custom SELinux Policy:

      grep avc /var/log/audit/audit.log | grep your_app_context > myapp-denials.log
      audit2allow -M myapp-socket -i myapp-denials.log
      semodule -i myapp-socket.pp

      This will create and load a policy module that allows the necessary permissions for your app.

      I hope this info is helpful to you.

      Best Regard,
      patrick521

      @delamor said in QRemoteObjects not working when app is signed with system signature (Android):

      I am using QRemoteObject to communicate between processes, it works fine so far when the app is signed with a random certificate; but as I need some permissions only granted to apps that has the system signature I signed the app with that signature and then QRemoteObject stops working.

      The failure appears here:

      m_repNode.connectToNode(QUrl(QStringLiteral("local:servicemessenger")));

      m_repService = QSharedPointer<ServiceMessengerReplica>(
      m_repNode.acquire<ServiceMessengerReplica>());

      bool res = m_repService->waitForSource();
      res is null when system signature and true when random signature. I am not seeing anything relevant on logs.. anyone knows what is happening ?

      I am seeing in logs SELinux blocking the creation of socket files, I think that's the cause but I am not sure on solution for this.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        osos11
        wrote on last edited by
        #3

        @delamor
        If you have the root access on your android device, try the following code. The code is used to change Selinux behavior "enforcing" to "permissive".

        setenforce 0
        

        After that your Qt app will work properly . Then you should check the SeLinux logs and share them with us.

        Please write me the details of your Android device. Are you using custom AOSP build or stock firmware?

        @patrick521
        What you mentioned is not suitable for Android.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved