Loading adb/fastdeploy/deployagent/src/com/android/fastdeploy/DeployAgent.java +12 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading adb/fastdeploy/deploypatchgenerator/src/com/android/fastdeploy/DeployPatchGenerator.java +4 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading Loading @@ -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)); } } Loading Loading
adb/fastdeploy/deployagent/src/com/android/fastdeploy/DeployAgent.java +12 −5 Original line number Diff line number Diff line Loading @@ -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 { Loading
adb/fastdeploy/deploypatchgenerator/src/com/android/fastdeploy/DeployPatchGenerator.java +4 −3 Original line number Diff line number Diff line Loading @@ -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()); } Loading Loading @@ -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)); } } Loading