I am trying to use script encryption feature available in android export. I have followed each and every step as in following pages, but my game crashes when starting. adb logcat shows multiple errors as follows:
ERROR: The MD5 sum of the decrypted file does not match the expected value. It could be that the file is corrupt, or that the provided decryption key is invalid.
Previously I used Godot 3.3 on Windows 10. But as the source downloaded was for 3.3.2, I downloaded Godot 3.3.2 & tried the same process again but still no luck.
After downloading source for 3.3.2.stable, I followed this procedure:
In https://asecuritysite.com/encryption/keygen I selected aes-256-cbc & generated key. I got salt, key & iv
Opened command prompt & used the above key in set SCRIPTAES256ENCRYPTIONKEY=yourgenerated_key command
Then executed following commands in shown order:
scons platform=android target=release androidarch=armv7
scons platform=android target=release androidarch=arm64v8
scons platform=android target=releasedebug androidarch=armv7
scons platform=android target=releasedebug androidarch=arm64v8
I got some new files in bin folder without any errors
Out of those files I copied androidrelease.apk & androiddebug.apk to C:\Users\Digital\AppData\Roaming\Godot\templates\3.3.2.stable. (Files with same names were already present in that folder, so I renamed the older files)
In export settings set the above files in respective custom templates
In export settings, set script export mode to Encrypted & set the same key here
When tried to run the project on android device with script mode to encrypted, splash screen appear for some time then the game is crashed. If the mode is set to compiled then the game is run normally.