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

Commit 3cde4234 authored by Idries Hamadi's avatar Idries Hamadi Committed by android-build-merger
Browse files

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

am: fafd2115

Change-Id: I9ca9718f196a1eed49060c27e5d261f16d3163d0
parents bc05312e fafd2115
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));
                }
            }