Open DiagonalArg opened 15 hours ago
I'll happily fix that (whenever possible) if I knew how!
That is the Github apk, which is built directly from a Github action. I don't use any libraries, and from what I could find, those are automatic files just for metadata, even if they were changed the app should not care, apparently.
The only thing I can think of is to use a different signing version (I know there are v1, v2, v3 and even v4?) and I don't really know which one I'm using. Do you know of any parameters, perhaps in the build.gradle file, that I should add to fix this?
Thanks for responding. :)
I'll see if I can find out....
I'm not a dev, but I asked someone who is. He said, "I'm hesitant to give advise since I know almost nothing about his development. So take this w/a grain of salt..."
Here it is:
Identify the purpose of the file: META-INF/com/android/build/gradle/app-metadata.properties is likely a build configuration file generated by your Android project’s Gradle build script. It contains metadata about your app, such as its package name, version, & other build settings.
Remove or move the file: As the warning suggests, you can safely delete or move this file outside of the META-INF directory. This will prevent the APK signature verification tool (apksigner) from complaining about an unprotected JAR entry. To do this, you can:
• Delete the file manually from your project’s build/intermediates/merged_assets directory (or similar, depending on your project’s structure). • Use a Gradle task or script to remove or move the file as part of your build process.
Alternatively, sign the file: If you need to keep the file for some reason (e.g., it’s used by your app), you can sign it using a digital signature. This will ensure that any modifications to the file will be detected during APK signature verification. To sign the file, you’ll need to: • Create a keystore (e.g., using keytool) & generate a certificate. • Use a tool like jarsigner or apksigner to sign the app-metadata.properties file with the certificate.
Verify the APK: After removing or signing the file, re-run the APK signing & verification process to ensure that the warning is no longer present.
Remember to carefully evaluate the impact of removing or signing this file, as it may affect your app’s build process or functionality. If you’re unsure, consider consulting your project’s documentation or seeking guidance from your team/lead.
From what I could find, this is an issue with the APK signature v1, which doesn't signs files inside the META-INF folder. Signatures v2+ do sign them and have no issue.
A google search of "META-INF/com/android/build/gradle/app-metadata.properties" will give several answers to this, like https://stackoverflow.com/questions/77543352/a-file-not-protected-by-signature-unauthorized-modifications-to-this-jar-entry, https://github.com/signalapp/Signal-Android/issues/13270, etc.
I'm interested however in which signing version I'm using, as I'm not specifying anything so it's probably the default. Is it v1 only? or v1+v2? Does the output of apksigner says something about this? (I think you need to add the --verbose flag)
If I'm only using v1, I should configure it to use both v1 and v2 (at least). If I'm already using v2 it should not be an issue, since devices that support v2 will verify everything, and for older devices that only support v1 I prefer to keep the compatibility instead of making them unable to install the app.
Perhaps I could also remove the files as you suggested, but they are automatically built files, and I prefer to avoid touching those.
Steps to reproduce
I wonder if the dev might be willing to repair this warning from
apksigner
. It would help support consistency with AppVerifier.Expected behavior
No warning.
Actual behavior
warning
URLCheck version
2.1.7 and 3.0
Android version
Android 15
Android Custom/Specific ROM or Device
GrapheneOS
Other details
No response
Acknowledgements