| | |
| | | * @return |
| | | */ |
| | | private static String extractLibrary(String libName) { |
| | | return extractLibrary("", libName); |
| | | return extractLibrary("/lib", libName);
|
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | extractedLibFile = new File(nativeTempDir + libFullName); |
| | | reader = new BufferedInputStream(in); |
| | |
|
| | | // 检查文件夹是否存在,如果不存在则创建
|
| | | File parentDir = extractedLibFile.getParentFile();
|
| | | if (!parentDir.exists()) {
|
| | | parentDir.mkdirs();
|
| | | }
|
| | |
|
| | | writer = new FileOutputStream(extractedLibFile); |
| | | byte[] buffer = new byte[1024]; |
| | | while (true) { |
| | |
| | | writer.close(); |
| | | in.close(); |
| | | } catch (Exception e) { |
| | | //System.out.println("dynamic file[ "+ fileName+ " ] not found in project.please ensure you need this library."); |
| | | System.out.println("dynamic file[ " + fileName + " ] not found in project.please ensure you need this library.");
|
| | | } |
| | | return extractedLibFile != null ? extractedLibFile.getAbsolutePath() : ""; |
| | | } |