3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 15:22:16 +00:00

Payment protocol: fix broken reflection code for Android.

This commit is contained in:
Mike Hearn 2014-01-30 15:32:17 +01:00
parent b3bf4aadb7
commit 7c9651a801

View File

@ -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");