Skip to content

Commit

Permalink
opt: can clear dexkit cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
HChenX authored May 30, 2024
1 parent 135fc72 commit f1c085a
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,37 @@ public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOEx
}
}

pubilc static void clearCache(){
clearCache(getFile(callTAG)):
}

public static void clearCache(@NonNull String path) {
FileUtils.delete(path, new FileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete(file);
XposedLogUtils.logI(callTAG, "success delete file: " + file);
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {
return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
return FileVisitResult.CONTINUE;
}
});

}

@NotNull
public static DexKitBridge getDexKitBridge() {
if (privateDexKitBridge == null) {
Expand Down

0 comments on commit f1c085a

Please sign in to comment.