mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 09:39:25 -04:00
Fix pottentially improper unpacking
This commit is contained in:
parent
e4dac248e0
commit
12510ca242
@ -224,7 +224,7 @@ public abstract class BaseLauncherActivity extends BaseActivity {
|
||||
Thread t = new Thread(() -> {
|
||||
try {
|
||||
String name = getFileName(this, uri);
|
||||
MultiRTUtils.installRuntimeNamed(getContentResolver().openInputStream(uri), name,
|
||||
MultiRTUtils.installRuntimeNamed(getApplicationContext().getApplicationInfo().nativeLibraryDir, getContentResolver().openInputStream(uri), name,
|
||||
(resid, stuff) -> BaseLauncherActivity.this.runOnUiThread(
|
||||
() -> barrier.setMessage(BaseLauncherActivity.this.getString(resid, stuff))));
|
||||
MultiRTUtils.postPrepare(BaseLauncherActivity.this, name);
|
||||
|
@ -389,7 +389,7 @@ public class PojavLoginActivity extends BaseActivity {
|
||||
final Uri uri = data.getData();
|
||||
Thread t = new Thread(() -> {
|
||||
try {
|
||||
MultiRTUtils.installRuntimeNamed(getContentResolver().openInputStream(uri), getFileName(this, uri),
|
||||
MultiRTUtils.installRuntimeNamed(getApplicationContext().getApplicationInfo().nativeLibraryDir, getContentResolver().openInputStream(uri), getFileName(this, uri),
|
||||
(resid, stuff) -> PojavLoginActivity.this.runOnUiThread(
|
||||
() -> {
|
||||
if (startupTextView != null)
|
||||
|
@ -75,7 +75,7 @@ public class MultiRTUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void installRuntimeNamed(InputStream runtimeInputStream, String name, RuntimeProgressReporter progressReporter) throws IOException {
|
||||
public static void installRuntimeNamed(String nativeLibDir, InputStream runtimeInputStream, String name, RuntimeProgressReporter progressReporter) throws IOException {
|
||||
File dest = new File(RUNTIME_FOLDER,"/"+name);
|
||||
File tmp = new File(dest,"temporary");
|
||||
if(dest.exists()) FileUtils.deleteDirectory(dest);
|
||||
@ -87,6 +87,7 @@ public class MultiRTUtils {
|
||||
runtimeInputStream.close();
|
||||
uncompressTarXZ(tmp,dest,progressReporter);
|
||||
tmp.delete();
|
||||
unpack200(nativeLibDir,RUNTIME_FOLDER + "/" + name);
|
||||
read(name);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user