Fix extract...

This commit is contained in:
khanhduytran0 2020-09-10 12:32:51 +07:00
parent b344fee33a
commit 0fee980626

View File

@ -386,7 +386,7 @@ public class PojavLoginActivity extends AppCompatActivity
return new File(selectedFile.toString()); return new File(selectedFile.toString());
} }
private void uncompressTarXZ(final File tarFile, final File dest) throws IOException, ErrnoException { private void uncompressTarXZ(final File tarFile, final File dest) throws IOException {
dest.mkdir(); dest.mkdir();
TarArchiveInputStream tarIn = null; TarArchiveInputStream tarIn = null;
@ -424,7 +424,11 @@ public class PojavLoginActivity extends AppCompatActivity
File destPath = new File(dest, tarEntry.getName()); File destPath = new File(dest, tarEntry.getName());
if (tarEntry.isSymbolicLink()) { if (tarEntry.isSymbolicLink()) {
destPath.getParentFile().mkdirs(); destPath.getParentFile().mkdirs();
android.system.Os.symlink(tarEntry.getName(), tarEntry.getLinkName()); try {
android.system.Os.symlink(tarEntry.getName(), tarEntry.getLinkName());
} catch (ErrnoException e) {
e.printStackTrace();
}
// unpackShell.writeToProcess("ln -s " + tarEntry.getName() + " " + tarEntry.getLinkName()); // unpackShell.writeToProcess("ln -s " + tarEntry.getName() + " " + tarEntry.getLinkName());
} else if (tarEntry.isDirectory()) { } else if (tarEntry.isDirectory()) {
destPath.mkdirs(); destPath.mkdirs();