Skip to content

Commit

Permalink
Update RuntimeUtils.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirosakiMio committed Feb 1, 2025
1 parent 527a47e commit df0f696
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions FCL/src/main/java/com/tungsten/fcl/util/RuntimeUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
import java.util.logging.Level;

public class RuntimeUtils {

public static boolean isLatest(String targetDir, String srcDir) throws IOException {
File targetFile = new File(targetDir + "/version");
try (InputStream stream = RuntimeUtils.class.getResourceAsStream(srcDir + "/version")) {
if (stream == null) {
return true;
}
}
long version = Long.parseLong(IOUtils.readFullyAsString(RuntimeUtils.class.getResourceAsStream(srcDir + "/version")));
return targetFile.exists() && Long.parseLong(FileUtils.readText(targetFile)) == version;
}
Expand Down Expand Up @@ -134,7 +138,7 @@ public static void uncompressTarXZ(final InputStream tarFileInputStream, final F
public static void patchJava(Context context, String javaPath) throws IOException {
Pack200Utils.unpack(context.getApplicationInfo().nativeLibraryDir, javaPath);
File dest = new File(javaPath);
if(!dest.exists())
if (!dest.exists())
return;
String libFolder = FCLauncher.getJreLibDir(javaPath);
File ftIn = new File(dest, libFolder + "/libfreetype.so.6");
Expand Down

0 comments on commit df0f696

Please sign in to comment.