Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00b6e025 authored by Colin Cross's avatar Colin Cross
Browse files

locked_region_code_injection: copy jar timestamp to output

Copy the input jar's timestamps to the output jar to ensure
deterministic results.

Test: m checkbuild
Change-Id: Ifdd3ddc36c35429a0396b968dd3dd20b8cc57793
parent a1759a9b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@
 */
package lockedregioncodeinjection;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;

import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -24,8 +27,6 @@ import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;

public class Main {
    public static void main(String[] args) throws IOException {
@@ -74,6 +75,7 @@ public class Main {
        while (srcEntries.hasMoreElements()) {
            ZipEntry entry = srcEntries.nextElement();
            ZipEntry newEntry = new ZipEntry(entry.getName());
            newEntry.setTime(entry.getTime());
            zos.putNextEntry(newEntry);
            BufferedInputStream bis = new BufferedInputStream(zipSrc.getInputStream(entry));