Android Question Bad Base64 while obfuscating code when using license

PFlores81

Active Member
Licensed User
Longtime User
Is there any way around this? If I compile a standard build, everything works as it should. However, when i compile an Obfuscated release it will throw a java exception stating bad base 64 for the license key.
 

PFlores81

Active Member
Licensed User
Longtime User
Add a Log(YourKeyVariable) command and check its value.
The error in question is this
B4X:
java.lang.IllegalArgumentException:

com.android.vending.licensing.util.Base64DecoderException: Bad Base64 input character at 1: -65(decimal)

Not sure what you mean by add a log. I have it logging the license check and even while plugged in for debugging it still will not show me the logs, filtered or not. Previous versions of B4A I had no issues viewing the logs.

B4X:
Sub Activity_Create(FirstTime As Boolean)
  lc.Initialize("lc", ph.GetDeviceId, publicKey, "etc".GetBytes("UTF8"))
  lc.SetVariableAndValue("lca_1", "Value")
  lc.CheckAccess
 
Upvote 0

PFlores81

Active Member
Licensed User
Longtime User
Note that you can check the logs from the IDE, it is simpler.

For obfuscation to work properly the version code attribute must match the value in the manifest file. Have you checked "Do not overwrite manifest file" option?
Yes Sir, I write my own manifests, I have always checked off "Do not overwrite Manifest"

Never had an issue with obfuscation prior to invoking the license.
 
Upvote 0

PFlores81

Active Member
Licensed User
Longtime User
There is no good reason to use this option. It is only kept for backwards compatibility. All the changes can be done with the manifest editor.

Make sure that the value of versionCode in the manifest file matches the value in #VersionCode attribute.
Wow, I cannot believe it was right in front of my face the entire time and I did not even see it LOL. I changed the manifest around using the editor, made it pull values from the scripting in the app. and ofuscation worked for the license. wow. Thanks again Erel
 
Upvote 0
Top