Closed CDrosos closed 2 years ago
Im using version 4.0.2
I guess the error comes from:
public static IPublicKey GeneratePublicKey(string encodedPublicKey)
{
try
{
var keyFactory = KeyFactory.GetInstance(KeyFactoryAlgorithm);
return keyFactory.GeneratePublic(new X509EncodedKeySpec(Android.Util.Base64.Decode(encodedPublicKey, 0)));
}
catch (NoSuchAlgorithmException e)
{
Console.WriteLine(e.Message);
throw new RuntimeException(e);
}
catch (Java.Lang.Exception e)
{
Console.WriteLine(e.Message);
throw new IllegalArgumentException();
}
}
Does anyone know why?
I'm having the same issue. Doing some testing on Android purchases and now getting this error. The error happens at:
keyFactory.GeneratePublic(new X509EncodedKeySpec(Android.Util.Base64.Decode(encodedPublicKey, 0)));
Just to clarify, I followed the docs exactly as stated using the XOR key idea and am getting this error. Can it be due to "testing" and the fact that the purchases are not real purchases?
@CDrosos Have you figured out a workaround since you've posted this issue?
@assassin316 no i just return true and avoid checking the key because it always return an error. When i was using version 3 of InAppBilling the same code was working that it is not working on version 4. So for now i just return true
public Task<bool> VerifyPurchase(string signedData, string signature, string productId = null,
string transactionId = null)
{
return Task.FromResult(true);
}
I had test it in public release with real purchases and was not working
I would need to look at this, i haven't used it in a long while. I am not sure if the signed data comes back or how it works anymore.
I am removing this from the code and just documenting it.
I have made the billing functions exactly as the documentation and while in versions before 4 in was working now in a new app im getting this exception
Im pretty sure the Verify section is exactly as in the documentation and the public key is the correct one, does anybody know what is this exception about?
For public key im using public RSA with Base64 encoding key that is found from Google Play developer console/ Financial reports/ monetization-setup, is this the correct one?
This is also how i verify the purchase
If for example my public key was "123456789";