0
10-11 23:44:04.220 E/AndroidRuntime(15090): java.lang.NullPointerException
10-11 23:44:04.220 E/AndroidRuntime(15090):     at com.android.vending.licensing.LicenseValidator.verify(LicenseValidator.java:101)
10-11 23:44:04.220 E/AndroidRuntime(15090):     at com.android.vending.licensing.LicenseChecker$ResultListener$2.run(LicenseChecker.java:213)
10-11 23:44:04.220 E/AndroidRuntime(15090):     at android.os.Handler.handleCallback(Handler.java:615)
10-11 23:44:04.220 E/AndroidRuntime(15090):     at android.os.Handler.dispatchMessage(Handler.java:92)
10-11 23:44:04.220 E/AndroidRuntime(15090):     at android.os.Looper.loop(Looper.java:137)
10-11 23:44:04.220 E/AndroidRuntime(15090):     at android.os.HandlerThread.run(HandlerThread.java:60)

public void verify(PublicKey publicKey, int responseCode, String signedData, String signature) {
    String userId = null;
    // Skip signature check for unsuccessful requests
    ResponseData data = null;
    if (responseCode == LICENSED || responseCode == NOT_LICENSED ||
            responseCode == LICENSED_OLD_KEY) {
        // Verify signature.
        try {
            Signature sig = Signature.getInstance(SIGNATURE_ALGORITHM);
            sig.initVerify(publicKey);
            sig.update(signedData.getBytes());

Do you know how to ignore this kind of exception, this only happens in some devices. So users can't get the license. I found that my market_licensing library is still 1.0, but I can't find 2.0 or higher. plz help me.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
thecr0w
  • 2,148
  • 4
  • 33
  • 59

1 Answers1

0

Could you surround the content of the method in a try/catch for NullPointers? Not ideal, but it would give you a quick patch to allow you to notify the user something is wrong instead of crashing until you find a permanent fix.

eimmer
  • 319
  • 1
  • 3
  • 13