1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
--- a/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
+++ b/src/java.smartcardio/unix/classes/sun/security/smartcardio/PlatformPCSC.java
@@ -46,6 +46,7 @@
private final static String PROP_NAME = "sun.security.smartcardio.library";
+ private final static String LIB0 = "libpcsclite.so.1";
private final static String LIB1 = "/usr/$LIBISA/libpcsclite.so";
private final static String LIB2 = "/usr/local/$LIBISA/libpcsclite.so";
private final static String PCSC_FRAMEWORK = "/System/Library/Frameworks/PCSC.framework/Versions/Current/PCSC";
@@ -98,40 +99,9 @@
if (lib.length() != 0) {
return lib;
}
- lib = expand(LIB1);
- if (new File(lib).isFile()) {
- // if LIB1 exists, use that
- return lib;
- }
- lib = expand(LIB2);
- if (new File(lib).isFile()) {
- // if LIB2 exists, use that
- return lib;
- }
-
- // As of macos 11, framework libraries have been removed from the file
- // system, but in such a way that they can still be dlopen()ed, even
- // though they can no longer be open()ed.
- //
- // https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes
- //
- // """New in macOS Big Sur 11.0.1, the system ships with a built-in
- // dynamic linker cache of all system-provided libraries. As part of
- // this change, copies of dynamic libraries are no longer present on
- // the filesystem. Code that attempts to check for dynamic library
- // presence by looking for a file at a path or enumerating a directory
- // will fail. Instead, check for library presence by attempting to
- // dlopen() the path, which will correctly check for the library in the
- // cache."""
- //
- // The directory structure remains otherwise intact, so check for
- // existence of the containing directory instead of the file.
- lib = PCSC_FRAMEWORK;
- if (new File(lib).getParentFile().isDirectory()) {
- // if PCSC.framework exists, use that
- return lib;
- }
- throw new IOException("No PC/SC library found on this system");
+ // let dlopen do the work
+ lib = LIB0;
+ return lib;
}
private static native void initialize(String libraryName);
|