You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Update boot signing in InstallMagisk
This commit is contained in:
@@ -28,6 +28,9 @@ import com.topjohnwu.magisk.components.SnackbarMaker;
|
||||
import com.topjohnwu.magisk.receivers.DownloadReceiver;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -215,4 +218,13 @@ public class Utils {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void inToOut(InputStream in, OutputStream out) throws IOException {
|
||||
int read;
|
||||
byte buffer[] = new byte[4096];
|
||||
while ((read = in.read(buffer)) > 0) {
|
||||
out.write(buffer, 0, read);
|
||||
}
|
||||
out.flush();
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,8 @@ import java.util.jar.JarInputStream;
|
||||
|
||||
public class ZipUtils {
|
||||
// File name in assets
|
||||
static final String PUBLIC_KEY_NAME = "public.certificate.x509.pem";
|
||||
static final String PRIVATE_KEY_NAME = "private.key.pk8";
|
||||
public static final String PUBLIC_KEY_NAME = "public.certificate.x509.pem";
|
||||
public static final String PRIVATE_KEY_NAME = "private.key.pk8";
|
||||
|
||||
static {
|
||||
System.loadLibrary("zipadjust");
|
||||
@@ -32,7 +32,6 @@ public class ZipUtils {
|
||||
}
|
||||
|
||||
public static void unzip(InputStream zip, File folder, String path, boolean junkPath) throws Exception {
|
||||
byte data[] = new byte[4096];
|
||||
try {
|
||||
JarInputStream zipfile = new JarInputStream(zip);
|
||||
JarEntry entry;
|
||||
@@ -49,13 +48,9 @@ public class ZipUtils {
|
||||
}
|
||||
File dest = new File(folder, name);
|
||||
dest.getParentFile().mkdirs();
|
||||
FileOutputStream out = new FileOutputStream(dest);
|
||||
int count;
|
||||
while ((count = zipfile.read(data)) != -1) {
|
||||
out.write(data, 0, count);
|
||||
try (FileOutputStream out = new FileOutputStream(dest)) {
|
||||
Utils.inToOut(zipfile, out);
|
||||
}
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user