Skip to content

Commit

Permalink
Closable ApkBundle
Browse files Browse the repository at this point in the history
  • Loading branch information
REAndroid committed Apr 23, 2024
1 parent 0b559d8 commit 61f361f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/com/reandroid/apk/ApkBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
import com.reandroid.arsc.pool.TableStringPool;
import com.reandroid.arsc.pool.builder.StringPoolMerger;

import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;

public class ApkBundle {
public class ApkBundle implements Closeable {
private final Map<String, ApkModule> mModulesMap;
private APKLogger apkLogger;
public ApkBundle(){
Expand Down Expand Up @@ -196,6 +197,13 @@ private boolean hasOneTableBlock(){
}
return false;
}
@Override
public void close() throws IOException {
for(ApkModule module : mModulesMap.values()) {
module.close();
}
mModulesMap.clear();
}
public void setAPKLogger(APKLogger logger) {
this.apkLogger = logger;
}
Expand Down

0 comments on commit 61f361f

Please sign in to comment.