androidandroid-securityexception

throws SecurityException when signing with the default debug keystore


I am receiving a SecurityException since yesterday when I launch the service using signature protection level for permission with the default debug keystore. The strange thing is I wasn't receiving this error before yesterday and I didn't make any security related change.

On the other hand, my own keystore using for releases is still working good. Related AndroidManifest.xml part:

<permission android:name="com.my.app.privateservices"
    android:protectionLevel="signature" />

<service android:name=".MyService"
    android:permission="com.my.app.privateservices" />

Solution

  • As I make my service unreachable by setting my signature as a permission requirement, I got this error randomly when using the debug signature. I don't know the reason. But I delete the permission setting of my service while developing when I got this error and insert it again before signing the application. But, as I said, generally I don't get this error.

    I know that this is not the actual answer. But, it is a work around. Hope it helps someone else.

    Thanks.