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

Commit fafd2115 authored by Idries Hamadi's avatar Idries Hamadi Committed by Gerrit Code Review
Browse files

Merge "Fix fastdeploy issues when testing Boat Attack Unity3D demo"

parents e43c146e 49cdcfd3
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -142,14 +142,21 @@ public final class DeployAgent {
        BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));

        String packagePrefix = "package:";
        String packageSuffix = "=" + packageName;
        String line = "";
        while ((line = reader.readLine()) != null) {
            if (line.endsWith(packageSuffix)) {
                int packageIndex = line.indexOf(packagePrefix);
            int equalsIndex = line.indexOf("=" + packageName);
            return new File(line.substring(packageIndex + packagePrefix.length(), equalsIndex));
                if (packageIndex == -1) {
                    throw new IOException("error reading package list");
                }

        return null;
                int equalsIndex = line.lastIndexOf(packageSuffix);
                String fileName =
                    line.substring(packageIndex + packagePrefix.length(), equalsIndex);
                return new File(fileName);
            }
        }
        throw new IOException("package not found");
    }

    private static void extractMetaData(String packageName) throws IOException {
+4 −3
Original line number Diff line number Diff line
@@ -61,22 +61,22 @@ public final class DeployPatchGenerator {
            File hostFile = new File(apkPath);

            List<APKEntry> deviceZipEntries = getMetadataFromFile(deviceMetadataPath);
            System.err.println("Device Entries (" + deviceZipEntries.size() + ")");
            if (verbose) {
                sb = new StringBuilder();
                for (APKEntry entry : deviceZipEntries) {
                    APKEntryToString(entry, sb);
                }
                System.err.println("Device Entries (" + deviceZipEntries.size() + ")");
                System.err.println(sb.toString());
            }

            List<APKEntry> hostFileEntries = PatchUtils.getAPKMetaData(hostFile).getEntriesList();
            System.err.println("Host Entries (" + hostFileEntries.size() + ")");
            if (verbose) {
                sb = new StringBuilder();
                for (APKEntry entry : hostFileEntries) {
                    APKEntryToString(entry, sb);
                }
                System.err.println("Host Entries (" + hostFileEntries.size() + ")");
                System.err.println(sb.toString());
            }

@@ -130,7 +130,8 @@ public final class DeployPatchGenerator {

        for (APKEntry deviceZipEntry : deviceZipEntries) {
            for (APKEntry hostZipEntry : hostZipEntries) {
                if (deviceZipEntry.getCrc32() == hostZipEntry.getCrc32()) {
                if (deviceZipEntry.getCrc32() == hostZipEntry.getCrc32() &&
                    deviceZipEntry.getFileName().equals(hostZipEntry.getFileName())) {
                    identicalContents.add(new SimpleEntry(deviceZipEntry, hostZipEntry));
                }
            }