Skip to content

Commit

Permalink
Log reason of temp directory not deleted for #87
Browse files Browse the repository at this point in the history
  • Loading branch information
REAndroid committed Apr 11, 2024
1 parent 45cbdf6 commit 0751086
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/com/reandroid/apkeditor/merge/Merger.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import com.reandroid.arsc.chunk.xml.ResXmlElement;
import com.reandroid.arsc.value.Entry;
import com.reandroid.arsc.value.ValueType;
import com.reandroid.utils.StringsUtil;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -97,9 +98,26 @@ public void run() throws IOException {
mergedModule.close();
if(extracted){
Util.deleteDir(dir);
confirmDirectoryDeleted(dir);
Util.deleteDir(dir);
confirmDirectoryDeleted(dir);
}
logMessage("Saved to: " + options.outputFile);
}
private void confirmDirectoryDeleted(File dir){
if(!dir.exists()){
logMessage("Directory not exist: " + dir.getAbsolutePath());
return;
}
logMessage("Directory exists: " + dir.getAbsolutePath());
File[] files = dir.listFiles();
if(files == null){
logMessage("files == null");
return;
}
String message = "files.length = " + files.length + StringsUtil.join(files, "\n");
logMessage(message);
}
private File extractFile(File file) throws IOException {
File tmp = toTmpDir(file);
logMessage("Extracting to: " + tmp);
Expand Down

0 comments on commit 0751086

Please sign in to comment.