Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复Android 7.0 升级闪退问题 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/main/java/com/benmu/framework/manager/impl/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,22 +174,25 @@ public static void unZip(File fromFile, File toFile) {

}

public static byte[] extractZip(File zipFile, String entryName) {
public static String extractZip(File zipFile, String entryName) {
ZipFile zf = null;
ZipEntry ze = null;
byte[] buffer = null;
StringBuffer result = new StringBuffer();
try {
zf = new ZipFile(zipFile);
ze = zf.getEntry(entryName);
InputStream in = zf.getInputStream(ze);
int size = in.available();
buffer = new byte[size];
in.read(buffer);
in.close();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String line;

while ((line = br.readLine()) != null) {
result.append(line + "\n");
}
System.out.println(result);
} catch (IOException e) {
e.printStackTrace();
}
return buffer;
return result.toString();
}


Expand Down