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.
-
D delamor marked this topic as a regular topic on
-
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.
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.logGenerate 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.ppThis 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.
-
@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 0After 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.