From 7c9651a801d98fa034c6f8ee9959a9edc5608979 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Thu, 30 Jan 2014 15:32:17 +0100 Subject: [PATCH] Payment protocol: fix broken reflection code for Android. --- .../google/bitcoin/protocols/payments/PaymentSession.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/protocols/payments/PaymentSession.java b/core/src/main/java/com/google/bitcoin/protocols/payments/PaymentSession.java index 11236b82..1b1354d8 100644 --- a/core/src/main/java/com/google/bitcoin/protocols/payments/PaymentSession.java +++ b/core/src/main/java/com/google/bitcoin/protocols/payments/PaymentSession.java @@ -512,10 +512,9 @@ public class PaymentSession { } try { // Check if we are on Android. - Class Build = Class.forName("android.os.Build"); - Object version = Build.getDeclaredField("VERSION").get(Build); + Class version = Class.forName("android.os.Build$VERSION"); // Build.VERSION_CODES.ICE_CREAM_SANDWICH is 14. - if (version.getClass().getDeclaredField("SDK_INT").getInt(version) >= 14) { + if (version.getDeclaredField("SDK_INT").getInt(version) >= 14) { // After ICS, Android provided this nice method for loading the keystore, // so we don't have to specify the location explicitly. KeyStore keystore = KeyStore.getInstance("AndroidCAStore");