|
|
@@ -126,27 +126,31 @@ public class SDLActivity extends Activity {
|
|
|
return filename.matches("^lib.*\\.so$");
|
|
|
}
|
|
|
});
|
|
|
- Arrays.sort(files, new Comparator<File>() {
|
|
|
- @Override
|
|
|
- public int compare(File lhs, File rhs) {
|
|
|
- return Long.valueOf(lhs.lastModified()).compareTo(rhs.lastModified());
|
|
|
+ String errorMsgBrokenLib = "";
|
|
|
+ if (files == null) {
|
|
|
+ errorMsgBrokenLib = "no libraries found in path \"" + libraryPath + "\"";
|
|
|
+ } else {
|
|
|
+ Arrays.sort(files, new Comparator<File>() {
|
|
|
+ @Override
|
|
|
+ public int compare(File lhs, File rhs) {
|
|
|
+ return Long.valueOf(lhs.lastModified()).compareTo(rhs.lastModified());
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ArrayList<String> libraryNames = new ArrayList<String>(files.length);
|
|
|
+ for (final File libraryFilename : files) {
|
|
|
+ String name = libraryFilename.getName().replaceAll("^lib(.*)\\.so$", "$1");
|
|
|
+ libraryNames.add(name);
|
|
|
}
|
|
|
- });
|
|
|
- ArrayList<String> libraryNames = new ArrayList<String>(files.length);
|
|
|
- for (final File libraryFilename : files) {
|
|
|
- String name = libraryFilename.getName().replaceAll("^lib(.*)\\.so$", "$1");
|
|
|
- libraryNames.add(name);
|
|
|
- }
|
|
|
|
|
|
- // Load shared libraries
|
|
|
- String errorMsgBrokenLib = "";
|
|
|
- try {
|
|
|
- if (onLoadLibrary(libraryNames))
|
|
|
- mIsSharedLibraryLoaded = true;
|
|
|
- } catch(UnsatisfiedLinkError e) {
|
|
|
- errorMsgBrokenLib = e.getMessage();
|
|
|
- } catch(Exception e) {
|
|
|
- errorMsgBrokenLib = e.getMessage();
|
|
|
+ // Load shared libraries
|
|
|
+ try {
|
|
|
+ if (onLoadLibrary(libraryNames))
|
|
|
+ mIsSharedLibraryLoaded = true;
|
|
|
+ } catch(UnsatisfiedLinkError e) {
|
|
|
+ errorMsgBrokenLib = e.getMessage();
|
|
|
+ } catch(Exception e) {
|
|
|
+ errorMsgBrokenLib = e.getMessage();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (!errorMsgBrokenLib.isEmpty())
|