Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit f41d08c

Browse files
committed
fix cacio, update gl4es
1 parent 4a0560c commit f41d08c

File tree

12 files changed

+66
-9
lines changed

12 files changed

+66
-9
lines changed

.idea/deploymentTargetDropDown.xml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

HMCLPE/src/main/assets/app_runtime/java/8-x86/lib/i386/libfreetype.so renamed to HMCLPE/src/main/assets/app_runtime/java/8-x86/lib/i386/libfreetype.so.6

File renamed without changes.

HMCLPE/src/main/assets/app_runtime/java/8-x86_64/lib/amd64/libfreetype.so renamed to HMCLPE/src/main/assets/app_runtime/java/8-x86_64/lib/amd64/libfreetype.so.6

File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
20
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
20
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
161
1+
162

HMCLPE/src/main/java/com/tungsten/hmclpe/launcher/setting/InstallLauncherFile.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
package com.tungsten.hmclpe.launcher.setting;
22

3+
import static net.kdt.pojavlaunch.utils.Architecture.ARCH_ARM;
4+
import static net.kdt.pojavlaunch.utils.Architecture.ARCH_ARM64;
5+
import static net.kdt.pojavlaunch.utils.Architecture.ARCH_X86;
6+
import static net.kdt.pojavlaunch.utils.Architecture.ARCH_X86_64;
37
import static org.apache.commons.io.FileUtils.listFiles;
48

59
import android.annotation.SuppressLint;
10+
import android.content.Context;
611
import android.content.Intent;
712
import android.os.Bundle;
813
import android.util.Log;
@@ -16,7 +21,11 @@
1621
import com.tungsten.hmclpe.utils.file.FileStringUtils;
1722
import com.tungsten.hmclpe.utils.file.FileUtils;
1823

24+
import org.apache.commons.io.IOUtils;
25+
1926
import java.io.File;
27+
import java.io.FileInputStream;
28+
import java.io.FileOutputStream;
2029
import java.io.IOException;
2130
import java.util.Collection;
2231
import java.util.Objects;
@@ -121,6 +130,11 @@ public static void checkJava8(SplashActivity activity, AssetsUtils.ProgressCallb
121130
AssetsUtils.getInstance(activity).setProgressCallback(callback).copyOnMainThread("app_runtime/java/8-x86_64",AppManifest.JAVA_DIR + "/default");
122131
}
123132
unpack200(activity.getApplicationContext().getApplicationInfo().nativeLibraryDir, AppManifest.JAVA_DIR + "/default");
133+
try {
134+
postPrepare(activity, "default");
135+
} catch (IOException e) {
136+
e.printStackTrace();
137+
}
124138
}
125139
}
126140

@@ -145,6 +159,11 @@ public static void checkJava17(SplashActivity activity, AssetsUtils.ProgressCall
145159
AssetsUtils.getInstance(activity).setProgressCallback(callback).copyOnMainThread("app_runtime/java/17-x86_64",AppManifest.JAVA_DIR + "/JRE17");
146160
}
147161
unpack200(activity.getApplicationContext().getApplicationInfo().nativeLibraryDir, AppManifest.JAVA_DIR + "/JRE17");
162+
try {
163+
postPrepare(activity, "default");
164+
} catch (IOException e) {
165+
e.printStackTrace();
166+
}
148167
}
149168
}
150169

@@ -171,6 +190,44 @@ private static void unpack200(String nativeLibraryDir, String runtimePath) {
171190
}
172191
}
173192

193+
public static void postPrepare(Context context, String name) throws IOException {
194+
File dest = new File(AppManifest.JAVA_DIR,"/" + name);
195+
if(!dest.exists()) return;
196+
String libFolder = "lib";
197+
String arch = "";
198+
if (net.kdt.pojavlaunch.utils.Architecture.getDeviceArchitecture() == ARCH_ARM) {
199+
arch = "aarch32";
200+
}
201+
if (net.kdt.pojavlaunch.utils.Architecture.getDeviceArchitecture() == ARCH_ARM64) {
202+
arch = "aarch64";
203+
}
204+
if (net.kdt.pojavlaunch.utils.Architecture.getDeviceArchitecture() == ARCH_X86) {
205+
arch = "i386";
206+
}
207+
if (net.kdt.pojavlaunch.utils.Architecture.getDeviceArchitecture() == ARCH_X86_64) {
208+
arch = "amd64";
209+
}
210+
if(new File(dest,libFolder + "/" + arch).exists()) libFolder = libFolder + "/" + arch;
211+
File ftIn = new File(dest, libFolder + "/libfreetype.so.6");
212+
File ftOut = new File(dest, libFolder + "/libfreetype.so");
213+
if (ftIn.exists() && (!ftOut.exists() || ftIn.length() != ftOut.length())) {
214+
ftIn.renameTo(ftOut);
215+
}
216+
217+
// Refresh libraries
218+
copyDummyNativeLib(context,"libawt_xawt.so", dest, libFolder);
219+
}
220+
221+
private static void copyDummyNativeLib(Context ctx, String name, File dest, String libFolder) throws IOException {
222+
File fileLib = new File(dest, "/"+libFolder + "/" + name);
223+
fileLib.delete();
224+
FileInputStream is = new FileInputStream(new File(ctx.getApplicationInfo().nativeLibraryDir, name));
225+
FileOutputStream os = new FileOutputStream(fileLib);
226+
IOUtils.copy(is, os);
227+
is.close();
228+
os.close();
229+
}
230+
174231
@SuppressLint("SetTextI18n")
175232
public static void enterLauncher (SplashActivity activity) {
176233
activity.loadingText.setText(activity.getString(R.string.loading_hint_ready));
0 Bytes
Binary file not shown.
4 KB
Binary file not shown.

0 commit comments

Comments
 (0)