Skip to content

Signing Validation Error on bundle release #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rupeshkumar22 opened this issue May 9, 2022 · 5 comments · Fixed by #694
Closed

Signing Validation Error on bundle release #691

rupeshkumar22 opened this issue May 9, 2022 · 5 comments · Fixed by #694

Comments

@rupeshkumar22
Copy link
Contributor

rupeshkumar22 commented May 9, 2022

SigningErrorBundle

It seems the Keystore path needs to be checked which is being used in the gradle.properties template. It looks like slashes are not being used in the returned Keystore file path.

I'm looking into it.

@codeanticode
Copy link
Member

That's strange, I'm not getting this error when I build the signed aab on Mac. Have you tried running the task from the command line directly in the temporary build directory where Processing stores the Android project. The full path is printed in the console:

image

@rupeshkumar22
Copy link
Contributor Author

After a lot of debugging related to the signing path, I have found the reason for the issue. The issue seems to be platform-specific(occurs on windows).
I tried running bundleRelease command directly at temp folder sketch path but the strange part was gradle.properties shows unchanged values as follows which creates a build error on direct execution-

org.gradle.jvmargs=-Xmx1536m
android.enableJetifier=true
android.useAndroidX=true

PROCESSING_UPLOAD_KEYSTORE_FILE=@@keystore_file@@
PROCESSING_UPLOAD_KEY_ALIAS=@@key_alias@@
PROCESSING_UPLOAD_STORE_PASSWORD=@@key_password@@
PROCESSING_UPLOAD_KEY_PASSWORD=@@key_password@@

So I assumed that the changes may reflect on runtime on processing4. So I printed gradle.properties file data on runtime and it was showing me the proper signing data as expected.
Later when I used print storeFile in ECJ gradle file, I found that it was not printing the correct value as mentioned in gradle.properties file and remove slashes as mentioned in the first screenshot on this issue.
Later, I changed the following line to include double slashes in the path of PROCESSING_UPLOAD_KEYSTORE_FILE in gradle.properties and the build was successful.
I changed this line-
replaceMap.put("@@keystore_file@@", AndroidKeyStore.getKeyStore().getAbsolutePath());
to the following-
replaceMap.put("@@keystore_file@@", AndroidKeyStore.getKeyStore().getPath().replaceAll("\\\\", "\\\\\\\\"));
which adds up the double slashes in the path of storeFile as follows-
C:\\Users\\Name\\Documents\\Processing\\android\\keystore\\processing-upload-keystore.jks

In short, if the path with a single slash is being used in gradle.properties for PROCESSING_UPLOAD_KEYSTORE_FILE
it shows a build error as mentioned in the top screenshot and print storeFile returns path without slashes.
If doubles back slashes are being used as mentioned by the above method of replace all, print storeFile returns path with single slashes, and the build gets successful.

I can resolve this with the condition to identify the platform and use replaceMap.put accordingly. But it would be better if I get confirmation from someone on running the Export Signed Bundle command on windows.

Thanks!

@codeanticode
Copy link
Member

@rupesh-kumar-lpu ok the strings between "@@" are replaced by Processing with the actual values (not include in the file for security reasons since they are the key store password, etc). But, it makes sense the error you are seeing on Windows caused by the wrong slashes... I will double check on my windows computer

@rupeshkumar22
Copy link
Contributor Author

@codeanticode thanks for clearing it Andres.

@codeanticode
Copy link
Member

@rupesh-kumar-lpu I confirm the error on Windows. It's strange, I thought I tested signed bundle export before, but anyways...

Your fix is good Also, I think that replacing backslashes with forward slashes would also work, see this other part of the code:

https://github.com/processing/processing-android/blob/master/mode/src/processing/mode/android/AndroidBuild.java#L404

If you create a PR, I will merge asap. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants