I have two apps which should communicate between themselves using AIDL.
I have defined app permission in server app (which has service provided AIDL interface implementation) and use this permission in client app (which connects to the server app).
Server app service is exportable, has intent filter and using defined permission from above.
Server app manifest:
<manifest
package="com.my.server">
...
<permission
android:name="com.my.app_permission"
android:protectionLevel="signature" />
<application
...
<service
android:name="com.my.MyService"
android:exported="true"
android:permission="com.my.app_permission">
<intent-filter>
<action android:name="my_aidl" />
</intent-filter>
</service>
</application>
</manifest>
Client app manifest:
<manifest
package="com.my.client">
...
<queries>
<package android:name="com.my.server" />
</queries>
<uses-permission android:name="com.my.app_permission"/>
<application
android:name=".App"
...
</application>
Client app App class:
class App: Application() {
fun onCreate() {
if (serverAppIntalled()) {
bindService(
Intent().apply {
action = "my_aidl"
package = "com.my.server"
},
serviceConnection,
Context.BIND_AUTO_CREATE
)
}
}
...
}
Every time when I tried I removed both apps and install server app first and then client app.
Debug builds work great.
Release APK builds signed with the same signature works great.
Unfortunately uploaded AAB for both apps uploaded for internal testing doesn't work and app throws SecurityException. When I remove protection level from defined permission it starts working.
Seems the issue is Google re-sign generated APKs for different Android versions from signed with the same key AABs I uploaded for internal testing and will upload for production as well.
Does anyone have an idea\solution how to fix signature protection level issue.
Thanks beforehand